Good vs. Evil

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,799
248
9 and.. I decided to bring multi threading to my game for the pathfinding section.

That does mean that the WASM build is broken now.

edit: Fixed the WASM build by swapping the multi threaded code out for a simple loop when it compiles to that. I also updated the github page to host the new WASM build :)
 
Last edited:

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,799
248
8 decided to look how long I could keep my game open using a release version of the native build before it would crap itself.

The game runs at a tps of 60 and every fifth tick a new object gets spawned that will run my basic pathfinding function. Which it will run EVERY tick.
The game started to crap itself only after 3 minutes. Or if my math is correct it took 2160 of those objects. Also, I accidentally left in a print statement inside of the calc_path function, meaning that I probably could've gotten better performance out of it.

Now, just replace my simple pathfinding thing for a real one and also put in some sort of cache so it doesn't have to run every update tick. After that, I don't think I need to fear pathfinding being a source of lag.
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,799
248
7 I... need to think of a better way to implement guis/huds into arena_keeper.

ITS SO MUCH BOILERPLATE JUST FOR A SINGLE BUTTON!
First, you need this piece of code:
upload_2019-6-30_23-12-3.png

This basically sets up an object that will act as the button. It will render the text as an image using the provided font when you create the object.

However, we need to load it together with the font using this piece of code: (Here ImmiExample is an earlier provided struct that will just be used as a container)
upload_2019-6-30_23-14-36.png

Here, we load font.ttf, make a style for it and then pass it all to Buttonstate so it can do its pre-render magic.

However, we are not there yet as we still haven't actually drawn anything. To do that we need this piece of code:
upload_2019-6-30_23-16-51.png


And all we have done now is create some text in the middle of the screen that says "normal button" when nothing is happening and "Hovered button" or "Clicked button" if you hover or clicked on it. It will also print "Test!" to the console when you click on it.

Also, if you want your assets to load before running the game you will need to implement that yourself. Luckily there is the "execute_or" method that takes 2 functions. One will run when its done loading when you call it and the other if you call it while it is still busy.
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,799
248
6 I finally got the results of the F# exam. These are the results for the practicum part:
Total number of people : 130
Amount of people who passed: 11 (8.5%)
average grade: 1.72
My grade: 7
5% of people scored my grade or higher

Note, the scale is from 1 to 10 with 10 being the best sore possible.
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,799
248
6 and I just watched an MTG Arena match where the amount of triggers got so out of hand that it took seconds for the game to actually calculate what the triggers where and several minutes for them all to happen.