Entrance Chat Gallery Guilds Search Everyone Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining the forum??
October 21, 2025 - @400.22 (what is this?)
Activity rating: Two Stars Posts & Arts: 22/1k.beats Unread Topics | Unread Replies | My Stuff | Random Topic | Recent Posts Start New Topic  Submit Art
News: :skull: Websites are like whispers in the night  :skull: Guild Events: There are no events!

+  MelonLand Forum
|-+  Virtual Worlds
| |-+  ❤︎ ∙ World Building
| | |-+  Implementing a save feature scares me


« previous next »
Pages: [1] Print
Author Topic: Implementing a save feature scares me  (Read 1857 times)
MediocreMetastasis
Sr. Member ⚓︎
****
View Profile WWWArt


Personal Text
⛺︎ My Room
Itch.io: My Games

Guild Memberships:
Artifacts:
Joined 2025!
« on: August 30, 2025 @278.14 »

This isn't a cry for help. I wanted to talk about how scary save features are. You can't just pause the game until the user wants to play the game again (Well I guess you can under extreme circumstances) so you have to find a way to save the current state to the hard drive. How do you do that? Save everything as a variable and write it to a text file.

For example, Half life 2 lets you save the game anywhere. Which means it needs to make the player's,enemies',all physic objects', projectile's position, rotation, velocity, torque, and ai state as well as ammo, current sound playing and it's current playback position all as variables just to write it to a text file.
Logged


Artifact Swap: Cheese StoneSideEyeDoggoDerp DoggoShocked DoggoSad DoggoHappy DoggoNeutral DoggoShocked SharaCool McgeeAgent JerrySunny the Puppy
candycanearter07
Hero Member ⚓︎
*****
View Profile WWWArt


i like slimes
⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: candycanearter
Itch.io: My Games
RSS: RSS

Guild Memberships:
Artifacts:
chansey!Goomy, I Choose You!Suck At Something September - Did It!uh oh! a pigeon got in!Artsy Candy CaneJoined 2024!
« Reply #1 on: August 31, 2025 @723.09 »

Pretty much everything IN programming is controlled by a variable... the issue is about saving ENOUGH to disk that you can get close enough to where you were before, and serializing/de serializing everything properly. Also, getting the variables OUT of the game can be frustrating if you have to get through encapsulation...
Logged

new to oldnet be nice





Artifact Swap: Sweet Stonecards all the way down
Melooon
Hero Member ⚓︎
*****
View Profile WWWArt


So many stars!
⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: melon
iMood: Melonking
Itch.io: My Games
RSS: RSS

Guild Memberships:
Artifacts:
coolest melon on the web!Emergency feel-good teaa silly heart 4 melon :)Hyperactive DonutGreat Posts PacmanThanks for being rad!
« Reply #2 on: August 31, 2025 @747.56 »

I was recently working on a project that I knew would need a save state, but I didn't really plan for it from the start and ended up with too many variables to easily save. I ended up having to write a mini program that saves your general place in the world, and then every time you load a save it basically simulates everything that would have happened up to that point in order to populate all the variables correctly.

It sounds like a silly solution, but as long as the simulated gameplay matches the real gameplay - it works quite well and means the entire save state can be just a single number  :tongue:
Logged


everything lost will be recovered, when you drift into the arms of the undiscovered

Artifact Swap: SapphireGreen DrinkLurbyLive Slow Die Youngspring 2023!Rising Star of the Web AwardMessage Buddy
MediocreMetastasis
Sr. Member ⚓︎
****
View Profile WWWArt


Personal Text
⛺︎ My Room
Itch.io: My Games

Guild Memberships:
Artifacts:
Joined 2025!
« Reply #3 on: September 02, 2025 @95.69 »

every time you load a save it basically simulates everything that would have happened up to that point in order to populate all the variables correctly.
If it works it works. If you can simulate everything that has happened the game must've been simple because I can't see how you can apply that to like a fps or especially a sandbox game.
Logged


Artifact Swap: Cheese StoneSideEyeDoggoDerp DoggoShocked DoggoSad DoggoHappy DoggoNeutral DoggoShocked SharaCool McgeeAgent JerrySunny the Puppy
Pages: [1] Print 
« previous next »
 

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021 | Privacy Notice | ~ Send Feedback ~ Forum Guide | Rules | RSS | WAP | Mobile


MelonLand Badges and Other Melon Sites!

MelonLand Project! Visit the MelonLand Forum! Support the Forum
Visit Melonking.Net! Visit the Gif Gallery! Pixel Sea TamaNOTchi