Doing some little work in my off time

I realise that the map is not displaying in the web version of the app when it was deploy to the github page.

Not really sure why , i got the warning for the COPY thing of the textures in the log and when i go the to network tab i see the data get loaded and in the log. So the texture seem the be render but not displaying, not sure, i’m not gonna stress to mutch about this for now. it’s nice to have integrate the library but i want to work on the base gameplay before focusing more on the map.

So for today my first goal is to setup the fast compilation and the scene loading to see more about the blezing fast hot reload i readed about in the home page, because with this i hope to have a nice and fast workflow because i don’t think i will be able to achieve my goal without this.

[WORKING]

So i made the following change:

  • Add nightly toolchain
  • Create a new make target run-dyn for development purpose for dynamic linking
  • I start using lld on my arch linux machine.

Before when i was doing a simple change like changing a string in the code the build time was around 6-7s now it’s 1-1.5s so great improvement.

New step in to use scene to put all the information about the game to no have to rebuild to app to make a change to the design and value of the property of the objects.

[WORKING]

Ohh my god , the lack of documentation for anything more than really basic is starting to get to me. I had a hard time figuring how to load my level from a file and re-render it every time it’s changing.

First i got it to work but without the hot-reload and at the end both where working fine.

The process is the following,

  • Create a custom asset loader for my type
    • Using ron the deserialize it
  • Create a startup system that load my map data and start the live reload
  • Create a system to render the map when it’s not rendered and the data is loaded
  • Create a system to listen to change on my asset server: on modifed despawn my map and set the rendering state to false

With this is working, the next step is the following:

  • Clean my map code and create a plugin to render the map
  • Add the map file path too to be created with the map

[WORKING]

This is done, now my map translation and path are store in my MapDataAsset. I had some issue with the live reloading that sometime is not working and the tiled map seem to have issue sometime redrawing after delete and create, seem to be an issue with the modification of the texture with the texture thing that need to be done. Also i created a new compnent MapElement for every element that is render when the map is created and deleted at the end. I could have use a child parent relationship like i wanted but i had issue soo i went with a component instead.

Yeah i’m really happy to have all this optimisation of my workflow done. Now i’m gonna try to implement some more game logic , if i want to survive a round soon.

The thing i want now is to have working bullet and windows.

The bullet need to be destroy by collider and be allowed to pass throw windows.

[WORKING]

Yeah i complete the collision for the bullet and the windows. I split the collision in two : ProjectileCollision and MovementCollision. My technique to edit my map is really shitty , i’m guessing manually the coordonate to put the windows and wall , and i split the wall around the windows. I need to research how to edit the map in a editor and fetch all of those data for the collider.

Next step is the fire projectile with mouse click and position

[WORKING]

I use the mouse position as a vector for the direction to send the projectile. Can be fired with mouse left or space.

It is time to getting started with the game mode and maybe soon kill my first zombie.

[WORKING]

It’s not all clean and perfect but i made the implementation of the basic game state and handling of those state. I didnt find if it was possible to add sub state for a particuliar state , so i just manually manage the state of the ZombieGame inside the Playing State, i was not able to found how to use the default derive with enum so i made a really cheap hack with unsafe code to convert i32 to enum.

[WORKING]

Path finding for the zombie , very basic but it’s working. I created a component to store the BotDestination and when i create a zombie it’s targetting the nearest window , when it inside it’s targetting the playing.

The next step with this is to make the reaction to the player movement faster by reducing the path store and make a state machine for the zombie.

Once it’s done the next thing i want to do is the wood panel on the windows that the zombie need to destroy before entering the inside. Doing this i’m gonna also make the zombie attack with the rate of attack and maybe a small animation to tell the attack is occuring.

I should put the zombie game settings in an asset file like for the map. They should be link together, a level is compose of a zombie game settings and a map.