Save, load, save, load then repeatsteemCreated with Sketch.

in #gamedev5 years ago (edited)

snap.jpg

As the title says... most of the week was spent working on saving and loading. I've done save/load once before, I did a save anywhere, anytime and everything solution. It was highly educational, in particular with using generics, but also took some time to create...

This time around I've decide to do a slightly more lightweight solution where the game saves at certain checkpoints only. Doing so gives you the ability to decide in much greater detail what you want to save, you can do specific save rooms for example and in those have nothing that changes appearance and only save whatever progress has been made. I'm adding some saving capabilities beyond progress tracking, thinking that the checkpoints should be somewhat easy to have in the levels and keep a nice flow.

A month or so ago, when I first started with this project, I quickly did a test to save and load object basic data, like position and velocity. Worked nicely and when I began working on the proper save/load, I simply continued on the tests that I had done ealier. Dumb mistake! Thankfully I did not spend too much time with it until I realized some planning might be good to have. Coffee + cookies = planning.

burp Planned how the game loads everything and where the save data should be injected in this process. In short the game first loads the map data from Tiled, then any basic scene create/loading is done, all the objects are created, all objects are told all objects are created and can do any in-between them configuration. At this point a level load is finished for how it is when you first load the level. If you are loading a saved game, here is where the next step comes in and the scene loads the saved data. It removes objects that were no longer present when the save was made and adds in new objects that had been created at the time of the saving. Then it continues with objects and they load any save data they might have and after that all is good to go for the player.

I've been trying to do everything so it works properly, but not 100% complete. Thinking I should move on as quickly as possible and go back later and improve as needed.

So far I have:

  • Basic gameobjects data for position, velocity, rotation etc
  • Tracking objects destroyed/added.
  • Sensors/Collisions keep their state.
  • Tweens. These are fantastic! Phaser has lots of great stuff, but tweens really are something. I've added basic support for tweening, but left out callbacks, timelines and more advanced features.

Left to do:

  • Timers
  • Events

When done with the last two, the test game is fully savable.

Have a splendid weekend!

(I did my best to use d.tube but unable to upload video yesterday and not today either, had to fallback on youtube)

Sort:  

Congratulations @smjn! Your post received a small up-vote from @wod-game as little gift.
We are a small group of people who want to create the next big Video game for Steem.
Want to know more about us?
Steem: @wod-game
Discord: Click here!

Have a nice Day!

Why thank you! You too!

This post has been revived by steem-forever and will get extra rewards. This happens when a post is upvoted on steem-bounty.com after the 7 day post life.

Users can simple upvote via steem-bounty.com continously, so posts can live and earn rewards forever.
Authors can share their steem-bounty.com links and get upvoted forever.

We hope this will allow everyone to earn more meaningful rewards over longer timeframes than before.

Ah cool I tried to learn javascript but seems I'm more kind of a designer.... Did also start creating a game years ago with construct 2 which make you put blocks of scripts/actions together.

As you can see with the test graphics I'm using I am not a designer ;)

Hahaha :D Well maybe we can work together someday ;). I found an old test video of the game I was working on 5 years ago. The design is crap as it were dummy graphics (with ridiculous sound samples) and had no clear idea what I was doing. Can't find the game I somehow deleted it from the website...

Haha oh that music combined with shotgun splatter gameplay!

Great combo :D yeah a friend made the music and while working on it I constantly heard it while testing making me crazy lol

Congratulations @smjn! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You made more than 5000 upvotes. Your next target is to reach 6000 upvotes.

Click here to view your Board
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:

Valentine challenge - Love is in the air!

You can upvote this notification to help all Steemit users. Learn why here!

It's always good to read these logical stuff. As a hobbyist gamedev, it keeps the code flow ticking in the back of my head.

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.032
BTC 61660.23
ETH 3056.45
USDT 1.00
SBD 3.82