Artifacts Gallery Guilds Search Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining?
a Summer night - @994.06 (what is this?)
Activity rating: Four Stars Posts & Arts: 63/1k.beats Random | Recent Posts | Guild Recents
News: Love is not possession  :4u: Guild Events: HOMESTUCK ART-APALOOZA

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


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


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

Guild Memberships:
Artifacts:
Joined 2025!
« on: a Summer night » Embed

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: The fingerSad DoggoNeutral DoggoAgent Jerry
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:
it's tbhchansey!Goomy, I Choose You!uh oh! a pigeon got in!Artsy Candy CaneJoined 2024!
« Reply #1 on: a Summer day » Embed

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
https://status.cafe/users/candycanearter/badge.png https://abslimeware.neocities.org/assets/images/blinkers/penguins.gif

https://abslimeware.neocities.org/assets/images/blinkers/slimebounce.gif https://card.exophase.com/2/0/268504.png?1727352149

https://i.imgur.com/S1cx8ZZ.pnghttps://i.imgur.com/7ntZZGM.pnghttps://i.imgur.com/xKIpW2A.pnghttps://i.imgur.com/YMPbu9R.png

Artifact Swap: buzzystickershoeBlob CreatureBall Creaturecards 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:
I got robbed by Dan Q on Melonland!Flinstone VitaminAlways working hard!Known Apple shillcoolest melon on the web!Emergency feel-good tea
« Reply #2 on: a Summer day » Embed

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: UnpleasantWildflowers!seahorseybitsy catRed TulipMellohiHelp, my tail is stuck!cyberziI met Dan Q on Melonland!?Stinky CheeseFlowersPlank
MediocreMetastasis
Sr. Member ⚓︎
****
View Profile WWWArt


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

Guild Memberships:
Artifacts:
Joined 2025!
« Reply #3 on: an Autumn night » Embed

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: The fingerSad DoggoNeutral DoggoAgent Jerry
Pages: [1] Print Embed 
« previous next »
 

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021 | Privacy Notice | Send Feedback | Supporters ♥ 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
MelonLand @000

Minecraft: Online
Join: craft.melonking.net