Hello ! I'm Elvis, a Game Programmer/Designer Twitter : @elvismdd About - Github - Projects - Contact
Don't wanna be here? Send us removal request.
Text
fishes
i have a unity asset published on the asset store called Fish Flock, it is meant to simulate a shoal of fish using steering behaviours.
it uses a parallel thread to calculate the steering forces and it applies on the main thread.
i recently had to fix a bug where the fishes were swimming away for no reason at all in two situtations: one was very random, like after 10 minutes for simulation, and the other was when the predator was eating the fishes, that was because the parallel thread had a reference to a List<T> that i hold all the fish behaviours, and i was removing a behaviour from ti when the predator ate a fish, so i just delayed this process by first deactivating the fish object on the hierarchy and then right before the next calculation request is sent to the parallel thread i go through a list that tells me what id’s i have to remove from the fish behaviours list. but the random swimming that did not seem to have connection with anything was also fixed with a redo on a part of the code, the two situation are the same: i was changing something from the main list while the parallel thread was using it, then the calculation stops and they start to swim forward to nowhere that makes sense.
4 notes
·
View notes
Text
truetype fonts
so it was very nice to write a bitmap font and render it, it was not too flexible as truetype fonts are, so one of the best libraries for processing ttf is freetype, but freetype contains a whole lot of code that needs to be build and i need it for android and urgh, i dont like things this way then i tried to use stb_truetype again, got some examples from github and it finally worked
it’s way better than with bitmap fonts... and it was very easy to set it up, it just requires a vertex, uv and index buffers together in a vertex array object, an array of stbtt_packedchar that contains all characters from the ttf packed together and you call some functions that arrange the characters on this array, then you can get the packed quad from each letter to mount your quad containing the letter and insert it together on the vertices, uvs and indexes. The rest is just opengl calls as everything else
0 notes
Text
new game
this month me and a friend of mine decided to make a small mobile game, then i started to write code from scratch using SDL layer for android. and today i finished the bitmap font loader
it’s a little mesh that contains a quad with 6 vertexes for each letter, it’s fairly simple, it works just like a sprite sheet for loading animation but instead you load an atlas with letters on it
it’s the first time i use bitmap fonts, i chose it instead of truetype fonts because 1) i never had wrote code for it then i thought it would be fun and 2) i would never write a ttf loader, instead i would use SDL_ttf but then i would have to link freetype too and then i got some errors and well, i like avoiding headache with stuff like that and also it’s a simple top-down stealth-like 2D game so who cares (i don’t)
0 notes
Video
tumblr
A small scene with a pirate ship and water I’ve made to chill out
2 notes
·
View notes
Photo
This Ludum Dare was amazing! Giving it some final touches, here is the link for the game https://elvismd.itch.io/ld38
0 notes