I finally finished (ish) my Dungeon Game with React and Redux. I have done anything I could to boost the performance (using shouldComponentUpdate, using ImmutableJs, using Redux Reselect) but still when there is no shadow applied to the tiles and you would move fast (keep pressing arrow keys) you will notice the lagging. Anyone has any suggestions for increasing performance even more?
@Neotriz I hear you man, for me that wouldn’t have been easy either. I used someone else’s work and thanked him and referenced this link on the project: http://bigbadwofl.me/
Although I have done a good amount of modification on his code the base is still his work cause I simply wasn’t too interested in spending time on generating a dungeon!
1- Fill the whole map with solid earth 2- Dig out a single room in the centre of the map 3- Pick a wall of any room 4-Decide upon a new feature to build 5- See if there is room to add the new feature through the chosen wall 6-i f yes, continue. If no, go back to step 3 7- Add the feature through the chosen wall 8- Go back to step 3, until the dungeon is complete 9- Add the up and down staircases at random points in map 10- Finally, sprinkle some monsters and items liberally over dungeon
All things considered I think you did a pretty good job optimizing.
If the lag bothers you one possible optimization would be waiting longer to render map moves, and then rendering bigger jumps.
What I did was wait until the player was ~5 spaces from the edge and then shift the map 10 spaces at once. Because the map isn’t constantly rendering the feedback feels quicker.
You are totally right! Like I said before because I did not create the dungeon generation algorithm I wasn’t savvy enough (interested enough) to fix its bugs! thanks for feedback though