Comments (14)
I can solve the draw order problem if you're not working on it. I think I've found an elegant solution for it
from civ2-clone.
A .SCN is basically a .SAV file but there are some differences in the binary layout. I'll try to find out what the differences are.
What the game does when you read a .scn:
- it looks for .gif files (Cities, units, etc.) in the local directory of the scenario. If it can't find those files, it uses gifs from root Civ2.
- similar procedure with city.txt, rules.txt, game.txt, labels.txt, pedia.txt, advice.txt
- title.gif (if it exits)
- scenario intro txt file (if it exits)
- sound files
- it loads EVENTS.TXT (if it exists)
- then it loads the game
If you load a .scn and it loads the events (either from .txt or you make the events in the events editor) and then save the game, the .sav then contains these events. A .scn may contain these events if they were added manually.
(Also - if you load a .scn in the civ2 root and then try to use the scenario editor, it will prompt you to choose a new scenario folder where it will then drop all the files. This is so that you don't mess with original gif/txt files in the root)
So basically we have to:
- add reading of events in .sav/.scn files (they may or may not be in there)
- make an EVENTS.TXT parser
- find out the layout of .scn files
- make some sort of ScenarioEvents class which will make these objects from read .sav game data in LoadedGameObjects.cs
- enable opening .scn from the main menu
and actions which the game uses:
from civ2-clone.
Our current file loading capability already has the ability to load the images and txt files from the sav or scn directory and then fall back to root if not found so there is not much to do there.
I would suggest getting the scenario loading and player selection working and worrying about the events as a separate task. Some scenarios such as the rome.scn don't even have events
from civ2-clone.
Ok I'll try to do scenario loading.
I also implemented events reading to get it out of the way.
from civ2-clone.
FW and MGE scenarios can be loaded now, but there are some minor issues with certain scenarios.
The loaded map appears blank, there's some issue with visibility or sth else, I'll have to look it up.
I had some trouble with popup boxes which are not listed in Game.txt (they are either read from scenario .txt files or are just custom dialogs, like player selection dialog for scenarios). I added these dialogs manually in Read.PopupBoxes since I don't know how to do a custom dialog.
Also some dialogs are duplicated (like difficulty/gender selection for load game and scenarios). I had to add additional classes for these. This can probably be done more elegantly.
from civ2-clone.
I tried it with the classic rome and ww2 scenarios but it seems it's not reading the data correctly not sure why. I get a null reference error as the values loaded are way outside the expected ranges
from civ2-clone.
Ww2 and Rome are two early Conflicts in civilization scenarios. The .scn and .sav structure are different than FW and MGE so I'll have to install CiC version of the game on my comp somehow to test it.
Try downloading some fw/mge scenarios from civfanatics or scenario league.
from civ2-clone.
FW and MGE scenarios can be loaded now, but there are some minor issues with certain scenarios. The loaded map appears blank, there's some issue with visibility or sth else, I'll have to look it up.
I found an issue in the visibility code so that may be the cause of what you're seeing here, I've now fixed it in my latest PR
from civ2-clone.
Ww2 and Rome are two early Conflicts in civilization scenarios. The .scn and .sav structure are different than FW and MGE so I'll have to install CiC version of the game on my comp somehow to test it. Try downloading some fw/mge scenarios from civfanatics or scenario league.
I don't think I was using CIC versions of the scenarios, I was using the default ones that come with MPG
from civ2-clone.
Correct, those two came with the base game.
Edit: ok I checked, hex editor indicates they're from <=2.42 version of the game. I'll try installing that version with wineVdm to test the file structure so we can read those & CIC scenarios. Also it would probably be wise to start adding changes so that we can read TOT sav files. At least TOT structure is well documented.
from civ2-clone.
MGE and those older two scenarios (ww2 & rome) that came bundled with the base game should now be ok.
I still need to make FW scn/sav files to work.
from civ2-clone.
I opened up both scenarios and they look good.
There seems to be something wrong with the fortress and airbase handling, there are airbases where there shouldn't be in WW2 scn and then a bunch that should be there are missing
from civ2-clone.
I'll look into it. Also FW scenarios and load games work.
You'll get some obscure errors in some scenarios, mostly additional whitespaces in strings, inconsistencies in Rules file, etc.
So only TOT left, but I'm guessing TOT will require adding more properties to cities, units, ... that don't exist in MGE.
from civ2-clone.
Fortress and airbase should be fixed now, unlike other tiles they are 48 px high. But it's not a very elegant solution.
Another problem is that fortress should be drawn only after units are drawn.
Same with city names - they are always last thing that is drawn on the map.
from civ2-clone.
Related Issues (20)
- Feature Request: use Bilinear/Bicubic interpolation scaling on zooming HOT 10
- Unit Actions HOT 4
- What civ can see vs what is there HOT 2
- Game type parameter for TOT
- Improvements in MPG vs TOT HOT 8
- RaylibUI.Mac does not exist HOT 2
- Adjust Menus for TOT HOT 1
- Menu styling HOT 2
- Update dialog tiles when loading game/scenario HOT 3
- Update status panel HOT 3
- Draw city size box
- Saving game HOT 5
- Game crashes when dead civ is chosen for next turn
- Don't update the map every time unit moves HOT 2
- Fastrandom bug? HOT 6
- Missing references - Broken code HOT 1
- Some issues with BitmapStorage
- Drawing with different zoom levels
- Search paths don't have the local sav/scn folder
- Raylib-cs and .net8 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from civ2-clone.