• What Are You Working On? - December 2014
    1,204 replies, posted
[thumb]http://files.1337upload.net/Screen_Shot_2014-12-18_at_00.50.55-676b1d.png[/thumb] oh my god im so fucking retarded jesus christ [thumb]http://files.1337upload.net/Screen_Shot_2014-12-18_at_00.54.20-cc0d9b.png[/thumb]
[QUOTE=AlTheUnderdog;46737500]-snip-[/QUOTE] Now that i'm looking at this, what's the proper way to handle 2d collision in fighting games? create hurt boxes when the attack animation hits certain point?
[QUOTE=eirexe;46737570]Now that i'm looking at this, what's the proper way to handle 2d collision in fighting games? create hurt boxes when the attack animation hits certain point?[/QUOTE] pretty much exactly what i did, the hit boxes there are separate objects from the players
[QUOTE=Darwin226;46737090]Hey, it's the GitHub thingies![/QUOTE] Trading cards with GitHub users on them? Yes, please.
[QUOTE=Fourier;46735995]Oh I see.. it copies values from -> to? But after 8 variables have been copied, it starts overwriting old ones? Like copying stuff into circle buffer with size of 8?[/QUOTE] Basically it's optimizing the copying from one place to another. We could copy stuff like this: [code] int n = 1000; while(n > 0) { *to = *from++; n--; } [/code] But then every time we go around that loop, we're performing the check n > 0, and we're decrementing n. We could improve it like this: [code] int n = 1000; while(n > 0) { *to = *from++; *to = *from++; n -= 2; } [/code] And so on. This reduces the number of decrements and comparisons by half. But what if we want to copy an odd number of bytes? Say we want 5 bytes: [code] int n = 5; while(n > 0) { *to = *from++; n--; *to = *from++; n--; } [/code] We've ended up copying 6 here. Too many! So we solve by doing one copy, then letting the while-loop handle the next 4: [code] int n = 5; *to = *from++; n--; while(n > 0) { *to = *from++; n--; *to = *from++; n--; } [/code] Okay that's cool but kind of verbose, especially when we get to 8 or so (since we have to do that manual adjustment in order to get a multiple of 8). A cool thing about C loops is that we can jump right into the middle of them. So say we have to copy 5 bytes again, we could do it like this (if this were syntactically valid): [code] int n = 5; int j = 5%2; while (n > 0): { *to = *from++; n--; label_to_jump_to_if_j_equals_1: *to = *from++; n--; } [/code] Since n = 5, j = 1. We have therefore got to skip one "copy" in order to end up with an even number of remaining "copy" statements, so that the while loop can do two at a time and not overrun like we did before. It's just a more concise way of saying what we did when we manually did one first. Now this can be scaled up to 8 like Duff's device, and instead of using my magical jump label, we use a switch-case. I hope that made sense.
[QUOTE=DarKSunrise;46737565][thumb]http://files.1337upload.net/Screen_Shot_2014-12-18_at_00.50.55-676b1d.png[/thumb] oh my god im so fucking retarded jesus christ [thumb]http://files.1337upload.net/Screen_Shot_2014-12-18_at_00.54.20-cc0d9b.png[/thumb][/QUOTE] Nice work! :) Now you should try making the atlas automatically increase in size whenever it runs out of room. It shouldn't forget what has already been inserted when this happens. (I usually generate a new image, and draw the old image on top of the new larger one in the correct dimensions. Only editing the node tree slightly so it knows it has more room now.) Then you'll have an efficient texture atlas library! Problem is that rasterizing individual pieces of text is usually better than pixel bitmaps. Perhaps you can incorporate them together somehow, but you should read a bit about it here: [url]http://blog.wolfire.com/2013/03/High-quality-text-rendering[/url]
Finished the latest version of my engine, [url]http://fuccboi.moe/[/url]. It’s built on top of LÖVE, so you can use Lua + LÖVE to program 2D games with it.
[QUOTE=adnzzzzZ;46738409]Finished the latest version of my engine, [url]http://fuccboi.moe/[/url]. It’s built on top of LÖVE, so you can use Lua + LÖVE to program 2D games with it.[/QUOTE] Why don't you put one of your thousand (but large) gifs in the examples? That's the kind of eye-candy psychology that will draw users to your library.
[QUOTE=Darwin226;46737090]Hey, it's the GitHub thingies![/QUOTE] I used identicon.js, I thought that the github generated avatars were perfect for what I wanted.
I've recently solved a dead-end that I hit whilst writing a light-weight, English-like-syntax (when using) state machine in C#, taking inspiration from the functional programming module I take at uni. When an event was encountered that did not correspond to a defined transition, with respect to the current state of a given machine, I had no idea what to return as the next state; I could either throw an exception and catch it internally (using exceptions for control flow - eww!), return null (requires verbose null checks - eww, and forcing the states to be a class - eww), or return a default value / magic value (just eww). Along comes the Maybe/Option monad to save the day!! The following code looks for a defined transition with respect to the given 'motive'. In short, it returns the next-state, if it is defined; otherwise the option 'None'. [code] public Option<TState> Impel(Entity entity, TEvent motive) { OnBehavior<TState, TEvent> onBehavior; return _stateTable.TryGetValue(motive, out onBehavior) ? onBehavior.Impel(entity, motive) : Option<TState>.None; } [/code] Here's the Option class, if anyone's interested - its nothing special. Feel free to use without credit - [Standard disclaimer about PC exploding] - it would be awesome if you let me know (out of curiosity!) [code] using System; using System.Collections.Generic; namespace Monads { /// <summary> /// Represents a monad that, optionally, encapsulates a value. /// </summary> /// <typeparam name="T"> /// The type of the encapsulated value. /// </typeparam> public struct Option<T> : IEquatable<Option<T>> { #region Fields private readonly bool _hasValue; private readonly T _value; #endregion #region Constructors /// <summary> /// Initializes a new instance of the Option class that encapsulates the /// specified value. /// </summary> /// <param name="value">The value to be encapsulated.</param> private Option(T value) { _hasValue = !ReferenceEquals(null, value); _value = value; } #endregion #region Properties /// <summary> /// Gets a special value that indicates the abscence of any valid encapsulated /// value. /// </summary> public static Option<T> None { get { return new Option<T>(); } } /// <summary> /// Gets a value indicating whether the current Option structure has a valid /// encapsulated value. /// </summary> public bool HasValue { get { return _hasValue; } } #endregion #region Methods /// <summary> /// Accepts a non-composable function and returns a function that accepts an /// Option type as input and returns the Option type. /// </summary> /// <typeparam name="TResult"> /// The type of the value encapsulated by the resultant Option type. /// </typeparam> /// <param name="function"> /// A non-composable function that maps the type <typeparamref name="T"/> to /// an Option of type <typeparamref name="TResult"/>. /// </param> /// <returns> /// A function that accepts an Option type as input and returns the Option /// type. /// </returns> public Option<TResult> Bind<TResult>(Func<T, Option<TResult>> function) { return HasValue ? function(OrDefault()) : Option<TResult>.None; } /// <summary> /// Retrieves the current Option structure's encapsulated value, if present; /// otherwise, retrieves the specified alternative value. /// </summary> /// <param name="alternative">The alternative value.</param> /// <returns> /// The current Option structure's encapsulated value, if present; otherwise, /// the specified alternative value. /// </returns> public T Or(T alternative) { return HasValue ? _value : alternative; } /// <summary> /// Retrieves the current Option structure's encapsulated value, if present; /// otherwise, retrieves the default value of its type. /// </summary> /// <returns> /// The current Option structure's encapsulated value, if present; otherwise, /// the default value of its type. /// </returns> public T OrDefault() { return HasValue ? _value : default(T); } /// <summary> /// Initializes a new instance of the Option class that encapsulates the /// specified value. /// </summary> /// <param name="value">The value to be encapsulated.</param> /// <returns> /// A new instance of the Option class that encapsulates the specified value. /// </returns> internal static Option<T> Some(T value) { return new Option<T>(value); } #region Equality /// <summary> /// Determines whether the specified object is equal to the current object. /// </summary> /// <param name="obj">The object to compare with the current object.</param> /// <returns> /// true if the specified object is equal to the current object; otherwise, /// false. /// </returns> public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) return false; return (obj is Option<T> && Equals((Option<T>)obj)) || (obj is T && Equals((T)obj)); } /// <summary> /// Compares the current Option to the specified Option. The result indicates /// whether both Options have valid encapsulated values and whether their /// encapsulated values are equal. /// </summary> /// <param name="other"> /// An Option, against which the current Option is to be compared. /// </param> /// <returns> /// true if both Options have valid encapsulated values and whether their /// encapsulated values are equal; otherwise false. /// </returns> public bool Equals(Option<T> other) { return other._hasValue ? Equals(other._value) : !_hasValue; } /// <summary> /// Compares two Option structures. The result indicates whether both Options /// have valid encapsulated values and whether their encapsulated values are /// equal. /// </summary> /// <param name="other"> /// A value, against which the current Option's encapsulated value, if any, is /// to be compared. /// </param> /// <returns> /// true if the Current Option has a valid encapsulated value and whether its /// encapsulated value is equal to the specified value; otherwise false. /// </returns> private bool Equals(T other) { return _hasValue && (_value.Equals(other)); } /// <summary> /// Returns a hash code for the current Option structure. /// </summary> /// <returns> /// An integer value that specifies a hash value for the current Option /// structure. /// </returns> public override int GetHashCode() { return _hasValue ? EqualityComparer<T>.Default.GetHashCode(_value) : 0; } #endregion #region Operators and Type Conversions /// <summary> /// Converts the specified object to an Option structure. /// </summary> /// <param name="value">The object to be converted.</param> /// <returns>The Option that results from the conversion.</returns> public static implicit operator Option<T>(T value) { return Some(value); } /// <summary> /// Compares two Option structures. The result indicates whether both Options /// have valid encapsulated values and whether their encapsulated values are /// equal. /// </summary> /// <param name="a">An Option to compare.</param> /// <param name="b">An Option to compare.</param> /// <returns> /// true if both Options have valid encapsulated values and whether their /// encapsulated values are equal; otherwise false. /// </returns> public static bool operator ==(Option<T> a, Option<T> b) { return a.Equals(b); } /// <summary> /// Compares two Option structures. The result indicates whether one or both /// Options do not have valid encapsulated values, or, whether their /// encapsulated values are not equal. /// </summary> /// <param name="a">An Option to compare.</param> /// <param name="b">An Option to compare.</param> /// <returns> /// true if one or both Options do not have valid encapsulated values, or, /// whether their encapsulated values are not equal; otherwise false. /// </returns> public static bool operator !=(Option<T> a, Option<T> b) { return !a.Equals(b); } #endregion #endregion } /// <summary> /// Represents a monad that, optionally, encapsulates a value. /// </summary> public static class Option { /// <summary> /// Initializes a new instance of the Option class that encapsulates the /// specified value. /// </summary> /// <typeparam name="T">The type of the value to be encapsulated.</typeparam> /// <param name="value">The value to be encapsulated.</param> /// <returns> /// A new instance of the Option class that encapsulates the specified value. /// </returns> public static Option<T> Some<T>(T value) { return Option<T>.Some(value); } } } [/code] In other news, my state-machine is now finished - I'll release as soon as its documented. Here's a sneak peak at the features: [code] /* * Creates a state-machine with states represented by the 'State' enum * and events by the 'events' enum, with the initial state being 'AtGround'. * * States and events can be defined by any type where instances of such are * equatable to one-another */ var elevator = new StateMachine<State, Event>(State.AtGround) {Enabled = true} // Adds an integer value of 100, called 'Capacity', to the machine's memory. elevator.AddValue("Capacity", 100); // Adds an integer value of 0, called 'Load', to the machine's memory. elevator.AddValue("Load", 0); /* Verify's whether, given an entity, a: * - The entity has a property 'Load', * - The entity has a property 'Capacity', * - Load <= Capacity. */ Func<Entity, bool> verifyLoad = entity => entity.GetValue<int>("Load") .Bind(load => entity.GetValue<int>("Capacity") .Bind<bool>(capacity => load <= capacity)) .OrDefault(); // Each state may have assocciated enty/exit actions. elevator .In(State.AtGround) .OnEntering(entity => Debug.WriteLine("Arrived at the ground floor.")); elevator .In(State.AtFirst) .OnEntering(entity => Debug.WriteLine("Arrived at the first floor.")); // Behavior may be defined over multiple states (and events) at once. elevator .In(State.AtFirst, State.AtGround) .OnExiting(entity => Debug.WriteLine("Doors closing.")); // If 'elevator' is in the state 'AtGround' and recieves the event // 'CalledFromFirst', it will transition to the 'AtFirst' state, if the load // is verified; otherwise it will transition to the 'Broken' state elevator .In(State.AtGround) .On(Event.CalledFromFirst) .Then((entity, motive) => verifyLoad(entity) ? State.AtFirst : State.Boken); elevator .In(State.AtFirst) .On(Event.CalledFromGround) .Then((entity, motive) => verifyLoad(entity) ? State.AtGround : State.Boken); elevator .In(State.Boken) .OnEntering(entity => Debug.WriteLine("Maximum load exceeded.")); // Call the eleveator from the first floor. elevator.Impel(Event.CalledFromFirst); elevator.SetValue("Load", 50); elevator.Impel(Event.CalledFromGround); elevator.SetValue("Load", 120); elevator.Impel(Event.CalledFromFirst); [/code] It also has guards - couldn't think of a sensible application here (They don't enable branching, just a check whether to bother evaluating the next state). Finally (SORRY FOR THE LONG POST!!), here's another application I've found in my Entity-Component system for that juicy monad! I have a 'Transform' component that does what it says on the tin. - It MAY have an owner (an Entity). - Its owner MAY have a parent. - The parent MAY have a transform. etc.. When applying a transform to a point I wanted to first check its owner's parent for a transform - if it has one, apply that first. Here's the method [code] public Vector Apply(Vector a) { return Owner.Bind( owner => owner.Parent.Bind( parent => parent.Transform .Bind<Vector>(transform => transform.Apply(a)))).Or(a) * Matrix.CreateRotation(Rotation) * Matrix.CreateScale(Scale.X, Scale.Y) + Position; } [/code] [HAPPY FACE!] This will be the first thing iv'e felt is vaguely worth releasing; C&C welcome!
[QUOTE=miceiken;46738618]Why don't you put one of your thousand (but large) gifs in the examples? That's the kind of eye-candy psychology that will draw users to your library.[/QUOTE] Why would I increase load times in a page where the main goal is to read code
[QUOTE=Crayz;46708604]Implemented an A* pathfinding system - [url]http://arongranberg.com/astar/front[/url] - gives me more control in the back-end with movement/access to pathing data etc. Also starting on my first iterations of the GUI/hud. [url]https://dl.dropboxusercontent.com/u/96502721/S/astar.mp4[/url] ...[/QUOTE] Networking is in action. I'm using a Lockstep model as explained here: [url]http://clintonbrennan.com/2013/12/lockstep-implementation-in-unity3d/[/url] Each "action" sends a packet containing a struct of data. Packets are sent using one command with various overload methods supporting different packet structs for various actions (containing data such as an entities unique id, owning player, move/attack destination, etc). Not sure if its the best or fastest way to do it, seems like networking actions can be a bit delayed sometimes, but it's a start. [url]https://dl.dropboxusercontent.com/u/96502721/S/lockstep.mp4[/url] Now to get my unit control mechanics implemented...
[QUOTE=Hattiwatti;46734761]Figuring out Frostbite 3 skeleton/bone classes. Thankfully most of the class info can be dumped straight from the game. Found override transforms for bones and now my ultimate goal is custom animations for cinematic purposes. I found out there's a script that can build a FB3 skeleton in 3ds max and the FBX SDK has clear documentation on how to import files and read bone position and rotation. Hopefully it'll work out. [t]https://pbs.twimg.com/media/B47B96TIIAEFe97.jpg:large[/t] [t]http://i.imgur.com/y6iAzCL.jpg[/t][/QUOTE] is the bone data stored in the chunks? or are you modifying this during runtime? -edit- working on my bmdconvert thing lets you convert OBJ/SMD to my BMD format Currently writting code to parse SMDs [IMG]http://puu.sh/dymZY.png[/IMG]
I've been staring at wireshark for 5 hours. Help
[QUOTE=ThePuska;46735883]Imagine this semi-hypothetical syntax where you could store labels in arrays. Switch-case is pretty much equivalent to it. [cpp]goto label[count % 8]; label[0]: do { label[7]: *to = *from++; label[6]: *to = *from++; label[5]: *to = *from++; label[4]: *to = *from++; label[3]: *to = *from++; label[2]: *to = *from++; label[1]: *to = *from++; } while(--n > 0);[/cpp][/QUOTE] Do goto statements work that way?
[QUOTE=proboardslol;46739267]Do goto statements work that way?[/QUOTE] No, that's why the original code used a switch statement.
Hey guys! It's been a while, been busy with school and my job. But I've found time to take a break from constant programming to... do more programming. I'm working on an HTML5 Game Engine because all the current ones that are out there kind of suck (imo). The goal is to come as close to feeling like SFML/[url=https://github.com/Rohansi/Californium]Californium[/url] as possible. So far I have sprites, text and rectangle primitives rendering and an asset manager, entities and states. [img]http://i.imgur.com/0OeF5T0.png[/img] (Sprite is blended and scaled) I still have a couple more weeks of work to put in on it but I'll throw it up on GitHub as soon as it's in a somewhat usable state.
[QUOTE=adnzzzzZ;46738409]Finished the latest version of my engine, [url]http://fuccboi.moe/[/url]. It’s built on top of LÖVE, so you can use Lua + LÖVE to program 2D games with it.[/QUOTE] Way to be subtle. Should've stuck with mogamett.
[QUOTE=DatZach;46739652]Hey guys! It's been a while, been busy with school and my job. But I've found time to take a break from constant programming to... do more programming. I'm working on an HTML5 Game Engine because all the current ones that are out there kind of suck (imo). The goal is to come as close to feeling like SFML/[url=https://github.com/Rohansi/Californium]Californium[/url] as possible. So far I have sprites, text and rectangle primitives rendering and an asset manager, entities and states. (Sprite is blended and scaled) I still have a couple more weeks of work to put in on it but I'll throw it up on GitHub as soon as it's in a somewhat usable state.[/QUOTE] Phaser is pretty nice.
[vid]http://webmup.com/N6M6o/vid.webm[/vid] Got my virtual joystick working really well. Snaps to your finger if it touches inside a certain zone then sticks wherever your finger goes until you let go, supports deadzones, locations are all relative so it can be moved around, supports scaling, supports multiple fingers, measures distance, etc etc. Each joystick is its own object and outputs when pollInput() is called. I should abstract it so I can use it without LibGDX :v: [editline]18th December 2014[/editline] holy fuck huge video one sec [editline]18th December 2014[/editline] okay I downscaled the video :v:
[QUOTE=adnzzzzZ;46738409]Finished the latest version of my engine, [url]http://fuccboi.moe/[/url]. It’s built on top of LÖVE, so you can use Lua + LÖVE to program 2D games with it.[/QUOTE] Did you actually name your engine "fuck boy"? Christ
Love2d raytracer magic [img]http://i.imgur.com/dYZt2Eq.png[/img] Nothing special, the performance is surprisingly OK. Used hump for its classes (i think they're neat). This is more of a port than a hand-made-doodad. [url=https://github.com/Bambofy/Love2D-RayTracer]messy-uncommented-code[/url]
[QUOTE=adnzzzzZ;46738409]Finished the latest version of my engine, [url]http://fuccboi.moe/[/url]. It’s built on top of LÖVE, so you can use Lua + LÖVE to program 2D games with it.[/QUOTE] Is there Windows 3.1 support?
[QUOTE=Darwin226;46740234]Phaser is pretty nice.[/QUOTE] I don't like the whole scene tree thing for 2d games, I much prefer entities inside of a manager drawing their own objects.
[QUOTE=DatZach;46741276]I don't like the whole scene tree thing for 2d games, I much prefer entities inside of a manager drawing their own objects.[/QUOTE] Soooo... a 1-level scene tree?
[QUOTE=sambooo;46740838]Did you actually name your engine "fuck boy"? Christ[/QUOTE] It actually doesn't sound anything like "fuck boy". I answered this in the FAQ: [QUOTE]Why is it called fuccboiGDX? First of all I know why you’re asking that and let me interject for a moment. You’re probably pronouncing fuccboi so that it sounds like “fuck boy”, but that is [B]wrong[/B]. The [I]u[/I] in [I]fucc[/I] is supposed to sound like the [I]u[/I] in [I]gucci[/I] or like [I]foo[/I] in [I]foobar[/I], and the [I]o[/I] in [I]boi[/I] should be closed, like in [I]coast[/I] or [I]koi[/I]. So [I]fuccboi[/I] should sound like “foochboi”. Having that said, I know that most people will pronounce it like “fuck boy” anyways, which is why I added GDX at in the end. [B]GDX[/B] is a combination of letters that passes a lot of [B]professionalism[/B] and so it’s used to offset the naturally dirty minds of everyone in the world.[/QUOTE]
I made an andoid app.. its on the play store if anyone wants to play it... I mean or you could download the free version Google Play [url]https://play.google.com/store/apps/details?id=com.garrystech.flightintime.android[/url] Direct Download [url]http://www.lvlupfitness.com/frostapple/Planet%20Defender%202.5.0.apk[/url] its a WIP
[QUOTE=adnzzzzZ;46741423]It actually doesn't sound anything like "fuck boy". I answered this in the FAQ:[/QUOTE] You can explain all you want, still not gonna help with branding.
[QUOTE=Darwin226;46741468]You can explain all you want, still not gonna help with branding.[/QUOTE] Well, it's free and open source. People can just change the name themselves if they want.
i think it's hilarious
Sorry, you need to Log In to post a reply to this thread.