Civ5 Ruleset and New Community Graphics+Sounds

Contribute, display and discuss rulesets and modpacks for use in Freeciv here.
ExeVirus
Posts: 4
Joined: Wed Feb 26, 2020 5:12 pm

Civ5 Ruleset and New Community Graphics+Sounds

Postby ExeVirus » Wed Feb 26, 2020 7:14 pm

Hello everyone, I'm very new to freeciv, and have been diving
deep into the source code and rulesets for a couple of weeks now :geek:...




Goals of the Freeciv-Neo Project

1. To create a new Ruleset for Freeciv that defines gameplay very similar to Civilization 5, with social policies, zone of control, un-stacked units, science gain, national unique units/buildings, unit promotions (as opposed to veterancy), religion (stretch goal), great people and associated tile improvements.

1-a. I will, if all goes as planned, attempt to make an AI specifically for this ruleset, though it will be complicated and new territory for me.

2. To create a truly HD tileset with 256x256 dimensions using automated capture methods combined with the Amazing 0.A.D. project.

The summary of this method is that I will be using Their built-in scripting console to auto-generate a map with every terrain tile (mountains, hills, etc) and every unit (I would add in missing units like anything past medieval times, and capture them from all 8 angles with screenshot tools built-in and autohotkey. Once this process of capture is complete, I will be writing a simple C++ (SDL) program that takes those screenshots and auto-cuts them into 256x256 squares. From there, a second program will take the 256x256 squares and auto-cut them into Hex, ISO-HEX, etc. tileshapes, and stitch them together into spritesheets able to be read by freeciv. At that point, likely, I will also create an auto-generated definition file for the generated tilesheets, allowing future customization.

All of these tools as well as a video tutorial (stretch goal) will be made available for you all to use.

3. To create a better selection of music and sound for freeciv. This will harness other open source projects for sound/music files, including 0.A.D., Battle for Wesnoth, Minetest, etc.

Likely, these files will be self-selected into what I consider a better soundset and musicset for freeciv, while trying to maintain tradition within freeciv.

4. Stretch goal: Get core dev support to add in 4-8 user-definable integer counters to each actor type (player, city, unit, tile) that would allow for keeping track of things like Religion, Great Person progress, Conversion Strength (for missionaries), etc.

------------------------------------------------------------------------
Progress
Current progress is mostly on my own end. I have made the initial github page for the project:

https://github.com/ExeVirus/FreecivNeo-Roadmap

Though, that project name will likely change and the project itself evolve quite drastically as I formalize.

I have already gotten as far as creating an autogenerated map in 0.A.D. that allows me to create the map precisely, and makes capturing units and buildings and terrain much easier. I have extensive experience with automating screenshots and keyboard input with autohotkey and will be using that as my capture script mechanism combined with built-in 0 A.D. screenshot functionality (that team did very well on this functionality).

I have also been working through the mechanics of the rulesets required quite heavily, and you can check my current thoughts on the GitHub read-me.

Sound and music progress has been mostly myself collecting the locations of all the different open source project sounds and music.
------------------------------------------------------------------------
Help/Contact
So I'm new to collaboration online for open source projects, and would love to have help with this project, especially if the core dev team is interested in helping me expand the source code to allow more functionality and victory types.

Right now, my best contact method is essentially just email with ddsallad (at) gmail. com (remove the spaces and replace the (at) with @). You can also create issues on the github page, and attempt to @ me on the Freeciv-Web discord (I'm Exe_Virus on there), so do what you prefer.

Ignatus
Elite
Posts: 330
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: Civ5 Ruleset and New Community Graphics+Sounds

Postby Ignatus » Wed Feb 26, 2020 8:38 pm

:o The plan sounds bold!
ExeVirus wrote:Stretch goal: Get core dev support to add in 4-8 user-definable integer counters to each actor type (player, city, unit, tile) that would allow for keeping track of things like Religion, Great Person progress, Conversion Strength (for missionaries), etc.

What do you mean? We already have id system for cities and units, though as I remember players/nations use a separate counter and tiles are referred by mere map array position as well as coordinate systems. Lua scripting environment has representation of such things as wrapped pointers that go to/from savegames by these game data (yet only from global vars).

ExeVirus
Posts: 4
Joined: Wed Feb 26, 2020 5:12 pm

Re: Civ5 Ruleset and New Community Graphics+Sounds

Postby ExeVirus » Wed Feb 26, 2020 8:52 pm

Ignatus wrote::o The plan sounds bold!
What do you mean? We already have id system for cities and units, though as I remember players/nations use a separate counter and tiles are referred by mere map array position as well as coordinate systems. Lua scripting environment has representation of such things as wrapped pointers that go to/from savegames by these game data (yet only from global vars).


Let's take a city as an example and religion as the use case. Right now, if I wanted to specify how many citizens in a city are following each religion there, how would I go about doing that? I envision each city having some user definable (via ruleset) integers.

Can you elaborate further on the Lua scripting wrapped pointers? Are you saying that I could include in savegames (and in-game) global lua variables? I.e. I could say city 1 with ID 23 has variable "X" attached to it? Because if so, then yes that would solve many of my current problems. What are the restrictions on said lua? I.e is there a max save file size for lua vars? How reliable are they? etc.


EDIT: If you do come back and read this, I was able to learn about Lua saves in savegame3. Currently we only save ints, bools, and strings. would it be possible to save and load tables if we extended this code? "Crosses fingers" That would be a hard requirement for implementing per city integers. I'm not going to be able to hardcode 400 variables for all the cities otherwise. I guess I could attempt to using strings and just parsing them.... They are technically arrays..... Sounds hacky...

Ignatus
Elite
Posts: 330
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: Civ5 Ruleset and New Community Graphics+Sounds

Postby Ignatus » Thu Feb 27, 2020 9:23 am

ExeVirus wrote:!Let's take a city as an example and religion as the use case. Right now, if I wanted to specify how many citizens in a city are following each religion there, how would I go about doing that? I envision each city having some user definable (via ruleset) integers.

Can you elaborate further on the Lua scripting wrapped pointers? Are you saying that I could include in savegames (and in-game) global lua variables? I.e. I could say city 1 with ID 23 has variable "X" attached to it? Because if so, then yes that would solve many of my current problems. What are the restrictions on said lua? I.e is there a max save file size for lua vars? How reliable are they? etc.

Lua variables are saved by Lua code itself and to a Lua code in a string generated by global _freeciv_state_dump(). In fact, it can be overwritten any time in a scenario without recompiling anything. I have some unfinished code that should save tables, see HRM#819533.
You already can use a city object retrieved by find.city(nil, 23) in a Lua variable, you can make it a key in a table city_data with the value {X = 35, religions = {Catholicism = 0.5}}, just current state dumper won't save them for backups and replays.

Ignatus
Elite
Posts: 330
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: Civ5 Ruleset and New Community Graphics+Sounds

Postby Ignatus » Thu Feb 27, 2020 3:14 pm

But actually you probably would better store most such data in city/unit structures since you will need to include them into the client-server protocol and display in the client. You could get around with some generalized call (see my idea here) but it will be too much work to make the interface to understand it, let alone the AI (you are going to make a game playable in single mode, right?).
BTW it would be worthy to try to bolt Wesnoth AI to Freeciv for this purpose since it handles Civ5-style "one unit per tile" combat. For cities, we can keep the default AI.

ExeVirus
Posts: 4
Joined: Wed Feb 26, 2020 5:12 pm

Re: Civ5 Ruleset and New Community Graphics+Sounds

Postby ExeVirus » Thu Feb 27, 2020 10:09 pm

Ignatus wrote:But actually you probably would better store most such data in city/unit structures since you will need to include them into the client-server protocol and display in the client. You could get around with some generalized call (see my idea here) but it will be too much work to make the interface to understand it, let alone the AI (you are going to make a game playable in single mode, right?).
BTW it would be worthy to try to bolt Wesnoth AI to Freeciv for this purpose since it handles Civ5-style "one unit per tile" combat. For cities, we can keep the default AI.


Interesting thoughts and ideas.

As of right now, I have a plan to use the server.showimg_playsnd for most of my user interface considerations. What this will allow is for me to make popups with sound and text. I can use the popup images and sounds to create wonder completion messages with a voice-over describing the wonder to the User. (immersion from Civ 5, very cool).

More usefully, I can use these pop-ups combined with custom-defined city action-enablers. For example, If I wanted to have a user interface for viewing religion info on a city, I would make an action enabler for all cities. When clicked, a signal for the action is sent to lua, which allows me to call up the server.showimg_playsnd to that player, which will include a graphic (header) and text underneath saying the values. Here's a mockup (paint.exe):

Religion Mockup.png
Religion Mockup.png (10.59 KiB) Viewed 1177 times


As you can see, it's still pretty basic, but would be supported on clients (as of 3.0). This concept can be reused as many times as I want to for various functions, such as social policies, more demographic views, etc.

For example, for social policies I plan on utilizing a graphic pop for viewing the social policy tree. The effects of each policy would be specified in chat (hopefully). Then, for general adoption, I would create a "Policy Expert" unit (when the conditions for one are met). This expert would have a bunch of action enablers for the different social policy trees. Basically, I envision an action button to cycle through (1-5) the different policies, and an action button to select which policy tree, and one to actually adopt the policy. Hopefully there are enough action enabler UI spots :)

Finally, just as an update, I have found about 85 songs for music so far in the CC world and open source world. Is it possible to specify more than one song to be played (i.e. shuffle playlist) or should I just use audacity and attach a set of songs in series and assume the game will auto-loop it?

jwrober
Posts: 18
Joined: Thu Jul 11, 2019 2:05 pm

Re: Civ5 Ruleset and New Community Graphics+Sounds

Postby jwrober » Fri Feb 28, 2020 2:40 pm

ExeVirus wrote:Finally, just as an update, I have found about 85 songs for music so far in the CC world and open source world. Is it possible to specify more than one song to be played (i.e. shuffle playlist) or should I just use audacity and attach a set of songs in series and assume the game will auto-loop it?


In 2.6+, music is specified via a .musicset file and plays songs based on mood. You can see my musicset here https://github.com/jwrober/SongOfDoom. Right now the game has an issue where it does not play all the music in a mood set, discussed here viewtopic.php?f=15&t=91331.

I like your ideas about adding in more client goodies and popups. I was thinking it would be cool to get a popup of the song and mood.

Lachu
Elite
Posts: 415
Joined: Sat May 04, 2013 2:19 pm

Re: Civ5 Ruleset and New Community Graphics+Sounds

Postby Lachu » Fri Feb 28, 2020 7:40 pm

Policies, golden ages and great people could be implemented as a ruleset of progress. I currently doesn't have much time to advance progress game, bu I would be happy to get some help or integrate changes to Freeciv.

ExeVirus
Posts: 4
Joined: Wed Feb 26, 2020 5:12 pm

Re: Civ5 Ruleset and New Community Graphics+Sounds

Postby ExeVirus » Sat Feb 29, 2020 11:11 pm

Lachu wrote:a ruleset of progress.


I don't quite understand what this means other than we would implement a new ruleset file into freeciv called [name].progressspec

I mean it sounds like it's exactly what is needed, but I have no idea how to structure such a spec file. Ideally one would be able to arbitrarily define city-based, unit-based, or player-based counters, define how they increase/decrease simply, and implement a requirement vector tie-in so that as these counters reach milestones, triggers for requirement vectors are met, allowing the effects file to take over.

Thoughts?

Ignatus
Elite
Posts: 330
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: Civ5 Ruleset and New Community Graphics+Sounds

Postby Ignatus » Sat Feb 29, 2020 11:38 pm

ExeVirus wrote:
Lachu wrote:a ruleset of progress.


I don't quite understand what this means other than we would implement a new ruleset file into freeciv called [name].progressspec

Pan Lachu is the author of yet another Freeciv-based game, he probably means he has done some things you want to do.

ExeVirus wrote:For example, If I wanted to have a user interface for viewing religion info on a city, I would make an action enabler for all cities. When clicked, a signal for the action is sent to lua, which allows me to call up the server.showimg_playsnd

That is not always comfortable. For example, you want to see linked strategical resources just in a corner of a city dialog, not in a popup. It's maybe also not efficient to make such queries to the server whenever you need the info - other city data are sent in a packet whenever a city is updated. That's why I think you need a more specific protocol. Of course you may develop more flexible protocol with throwing and buffering arbitrary data structures paired with extended ability of receiving client scripts to modify the interface but it seems to be a task of writing a browser with JS and Flash. Freeciv-Web uses existong browsers and it still has significantly limited gaming interface if compared to C-written clients. But I'm a very amateur programmer so feel free to discard anything that I say! :)