Author Topic: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC  (Read 6059 times)

0 Members and 1 Guest are viewing this topic.

Offline afwbkbc

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #105 on: March 28, 2023, 09:35:36 PM »
Map saving / loading done

Offline DrazharLn

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #106 on: March 28, 2023, 11:17:38 PM »
Congrats! Good luck with the weather algorithm and getting sprites up :)

Offline afwbkbc

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #107 on: March 29, 2023, 01:23:35 AM »
You probably meant CVRs, because sprites are already there (bonus resources and some terraforming are sprites)  :)
« Last Edit: March 29, 2023, 01:59:17 AM by afwbkbc »

Offline DrazharLn

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #108 on: March 29, 2023, 12:40:26 PM »
I had just forgotten about the terrain improvements because I was thinking about the sprites for bases and native life :D

As you've made a start on saving bits of game state, here are some of my personal pain points with SMAC's existing saves:

- settings and mods are not always saved with the rest of the game state, which makes it a pain to play saves using different mods
- saves are not rewindable, which can make debugging and development a pain. Saving info for rewinding would also allow some fun replay options when the game ends (or maybe you can trigger a replay of the last few turns as a recap, idk)

Here's a demo of Tomorrow Corporation's Dev tools:

Offline afwbkbc

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #109 on: March 29, 2023, 12:58:13 PM »
Replays are planned after v1.0, they will be separate from saves, which makes sense because somebody may want only saves but not replays, and other will want to record replay but not make saves every turn.
There will be a big difference in savegame format and replay format.
Savegame will contain full state.
Replay will contain initial map state on turn 1, and then every turn it will add all changes and actions by players and AIs.
Each is better for own use cases (replays are better optimized for every-turn updates but would be ridiculously slow to load from, savegames are better optimized for loading but making full savegame file every turn would be slower and waste of disk space).
Maybe replays will also record things like mouse movements and timings of actions, to be able to replay precisely later (exactly as player played it).

About "settings and mods are not always saved with the rest of the game state, which makes it a pain to play saves using different mods" - if it was a bug in SMAC then of course it won't be carried over  :)

Checked video, I think it will be overkill - implementing 'rewind' will take much more time than it will save later. For debugging a normal save is enough, and it will be possible to enable 'autosave each turn' and that's it. In debug builds it's also possible to save or load a full dump. So, if, as in video, I had null pointer somewhere, I can just put breakpoints where needed, then load save (or dump) of previous turn and get same result.
Also, debug build is already slow, adding rewind will make it even slower and memory-hungry (because it will also record history of everything).
Interesting approach tho.

Replays will have this rewind functionality, but they'll come after v1.0. Idk if it will be possible to rewind after actual exception or crash tho, maybe, if I'll find easy way to do it. Time spent on debugging tools should not exceed amount of time saved by them  :)
« Last Edit: March 29, 2023, 01:24:56 PM by afwbkbc »

Offline DrazharLn

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #110 on: March 29, 2023, 02:30:01 PM »
> About "settings and mods are not always saved with the rest of the game state, which makes it a pain to play saves using different mods" - if it was a bug in SMAC then of course it won't be carried over  :)

It's more a questionable design decision than a bug (tho there was also a bug but thinker fixes it). Scenarios embed the alphax.txt (and maybe some other files?) that are active at the time they're created. AFAIK, normal saves don't.

And then SMACX doesn't have a notion of mods really beyond that. You just have to overwrite the base files.

Re: rewinding/replay, I think an event log with occasional checkpoints would be an okay format (which seems to be how the tomorrow corporation version works) and would be handy for dev and modding, but I'm not the one writing it!

Offline afwbkbc

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #111 on: March 30, 2023, 12:25:19 AM »
Did some sprite optimizations today, then tried to kill FPS with terraforming  ;lol

Average PC - ~200000 sprites, ~75 FPS
Low-end VM - ~65000 sprites, ~59 FPS
There are more possible optimizations (such as lazy rendering) but for now it looks fast enough  8)

Offline DrazharLn

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #112 on: March 30, 2023, 09:08:35 AM »
Nice. I think a good performance test is whether it makes an old laptop noisy (from the fans spinning up). Unmodded SMAC does because it polls windows for events in a busy loop rather than waiting politely, tho this is fixed in thinker and by the smac-cpu-fix mod.

Offline afwbkbc

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #113 on: March 30, 2023, 09:28:22 AM »
How old is 'old laptop'? I sometimes test it on ASUS Zenbook UX302LG, I think it's from 2014 so 9 years old. GLSMAC uses around 15% of one CPU core when idle, on average standard map with some terraforming, I can hear fans but not much (they are louder if I compile something or watch youtube or just browsing, there's probably some dust requires cleaning too).
Supporting really old computers by specific optimizations is possible, but time-consuming, so it will be postponed, for now I'm targeting my zenbook (with integrated GPU and not NVidia) as lowest supported hardware specs. That, and virtual machine with 3GB of RAM, 2 cores of AMD A8 7600 and NVidia GT710 (it runs it on par with my laptop usually).
Later it should be possible to support even retro computers from 90s, as long as they have OpenGL 3  card.

Offline afwbkbc

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #114 on: March 31, 2023, 03:51:35 PM »
Added proper handling of map settings: ocean coverage, erosive forces, native lifeforms, cloud cover. Map generator is still basic but generates map with requested settings accurately.

Offline DrazharLn

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #115 on: March 31, 2023, 06:30:22 PM »
Sounds old enough to me! Good job with the map generator :)

Offline afwbkbc

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #116 on: March 31, 2023, 08:29:52 PM »
Just had issue where moons in main menu overlapped 'Sid' word, then it turned out they screwed SMACX background so it happens in original SMACX too.
However, this doesn't happen with original logo.
Then I also gave it some thought - and it really makes sense to put logo with name of actual game (Alpha Centauri) than of expansion, right? For example we don't want to confuse new players to think the game is called 'Alien Crossfire'.
Original logo also looks good with moons.
Are there any reasons to use Alien Crossfire text in main menu? For now I think - why not use original 'Alpha Centauri' logo but with Alien Crossfire theme. Also, logo color itself may be changed by opengl into something other than blue. Colors of menus and UI can be modified too. What do you think?

Offline DrazharLn

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #117 on: March 31, 2023, 08:58:39 PM »
As a SMACX disparager, I don't see any need to implement any of SMACX ;)

Offline afwbkbc

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #118 on: March 31, 2023, 09:04:44 PM »
Later there can be some easy selection/option added when starting game.
Can I find a full list of differences between SMAC and SMACX somewhere? Just to get the idea of how hard would it be to implement in universal way (if differences are only content like units and technologies - then fairly easy).
I actually played SMACX like 99% of time, barely remember how it was before expansion.

Offline afwbkbc

Re: GLSMAC - Open-source OpenGL/SDL2 remaster of SMAC
« Reply #119 on: March 31, 2023, 10:06:40 PM »
Added planet/moon effects as in SMAC

 

* User

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

* Community poll

SMAC v.4 SMAX v.2 (or previous versions)
-=-
24 (7%)
XP Compatibility patch
-=-
9 (2%)
Gog version for Windows
-=-
103 (32%)
Scient (unofficial) patch
-=-
40 (12%)
Kyrub's latest patch
-=-
14 (4%)
Yitzi's latest patch
-=-
89 (28%)
AC for Mac
-=-
3 (0%)
AC for Linux
-=-
6 (1%)
Gog version for Mac
-=-
10 (3%)
No patch
-=-
16 (5%)
Total Members Voted: 314
AC2 Wiki Logo
-click pic for wik-

* Random quote

I think, and my thoughts cross the barrier into the synapses of the machine - just as the good doctor intended. But what I cannot shake, and what hints at things to come, is that thoughts cross back. In my dreams the sensibility of the machine invades the periphery of my consciousness. Dark. Rigid. Cold. Alien. Evolution is at work here, but just what is evolving remains to be seen.
~Commissioner Pravin Lal 'Man and Machine'

* Select your theme

*
Templates: 5: index (default), PortaMx/Mainindex (default), PortaMx/Frames (default), Display (default), GenericControls (default).
Sub templates: 8: init, html_above, body_above, portamx_above, main, portamx_below, body_below, html_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 45 - 1228KB. (show)
Queries used: 36.

[Show Queries]