To make things easy for modders...

To make things easy for modders...

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

User avatar
FoeOfTheBee
Posts: 557
Joined: 12 May 2005, 18:26

To make things easy for modders...

Post by FoeOfTheBee »

why not have spring read unit and weapon information from an sql database instead of using tdf and fbi files?
User avatar
Kuroneko
Posts: 483
Joined: 03 Jan 2005, 05:32

Post by Kuroneko »

because every decent modder has an sql server on thier computer.
User avatar
SwiftSpear
Classic Community Lead
Posts: 7287
Joined: 12 Aug 2005, 09:29

Post by SwiftSpear »

TDF and FBI's are standard. We'd have to remake everything all new if it was changed.
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post by Gnomre »

Kuroneko wrote:because every decent modder has an sql server on thier computer.
Yes, we do. And PHP, and apache, and perl, and other crap I forget :)

Not hard to load it all up into sql, swift, it's easy to parse.
Sean Mirrsen
Posts: 578
Joined: 19 Aug 2004, 17:38

Post by Sean Mirrsen »

To Hell with SQL!

Plain text files are a lot friendlier to modders.
Also, when a new script system comes, we might not need separate definition files at all.
User avatar
Tim Blokdijk
Posts: 1242
Joined: 29 May 2005, 11:18

Post by Tim Blokdijk »

I'm a big SQL fan but in this case I would go with xml.
Wait up, we could use the Base Open Document files! :idea:
That way we have SQL and plain text xml files.

But the hole unit statistics stuff could use a overhaul.
Would be nice if you could change the FBI values on the fly and lets not forget the "fuse units" idea.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

You could do all that with GroupAI's, if only you removed the word const from the function declarations of GetUnitDef(), or at least provided a second version.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

When someone says "changing FBI values on the fly", he actually means having an instance of every config option in the unit itself. However a lot of the spring code assumes these are constant. In any case, I doubt many people would use the ability to change unit definitions on the fly, because then you would be changing all the units not just one.
It does sound nice for implementing "upgrades" though.. but the FBI stuff has to be replaced anyway so I think implementing those sort of things is a waste of time.
Last edited by jcnossen on 02 Jan 2006, 18:39, edited 1 time in total.
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Re: To make things easy for modders...

Post by PauloMorfeo »

Foe OfTheBee wrote:why not have spring read unit and weapon information from an sql database instead of using tdf and fbi files?
:lol:
I've thought about it many times. It's implementation problems were what's been keeping me from proposing that myself (yet). So i'm waiting for my Mod Editor to be made to, then, think better about it.

I thought specifically about MySql because you can add it's engine to other programs which are also GPL, which is compatible with Spring, it is widely used and tested and works on alot of diferent platforms which is good for the game's portability and for allowing many diferent platforms to develop mods for Spring.
Still one thing concerns me. That «new» way of handling mods based on «scripting», instead of the tags/fields, which could make such a system more or less useless!?

About having MySql running on a PC, in Windows i know for sure that having MySql running is very easy. The problem is messing with it's data which, if you're not Sql knowledgeable, will make you require a program specific for that.

About using xml, from the little i know about it, i think it could produce huge mod files wasting alot of space on the format. Also, i wonder if it wouldn't make it load much slower!?

I would like to see the performance of loading a full mod from an unoptimized Sql server and it's database file size to compare to how Spring is handling this right now.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

I would really not like the need to install mysql just to run spring actually. MySQL is suited for a large (think gigabytes) database that's constantly being modified. That's totally not the case for a game like spring, which is also why no commercial game has ever used such a solution. Using XML or your own way of defining units is much faster and easier IMO.
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

There is absolutely no reason to use mySQL. mySQL is a relational database and is very powerful as such for crossreferncing and all sort s of funky stuff. Simply put, TA tags andi nformation are flatfile databases, one dimensional. There is absolutely no reason to need mySQL to mod and it would be sheer stupidity.

Edit: Zap, even XML is overkill for TA. I actually have a DTD and i tihnk even a schema for TA units posted on the TA forums. XML is not the be all and end all of anything; the [property]=[val]; syntax works beautifully. I cant ever imagine needing to defining a unit's properties in anything more than that. Using XML would just add a lot more <> and </a> and clutter things up.
Last edited by Dragon45 on 02 Jan 2006, 20:02, edited 1 time in total.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

Dragon45 wrote:There is absolutely no reason to use mySQL. mySQL is a relational database and is very powerful as such for crossreferncing and all sort s of funky stuff. Simply put, TA tags andi nformation are flatfile databases, one dimensional. There is absolutely no reason to need mySQL to mod and it would be sheer stupidity.
100% agree. Leave it as it is.
User avatar
FoeOfTheBee
Posts: 557
Joined: 12 May 2005, 18:26

Post by FoeOfTheBee »

How about embedding sqlite, maybe using CppSQLite, which supposedly works with the gcc?

Then using an ODBC connector, modders could adjust unit characteristics in OpenOffice Base. They would never have to change a filename or worry about typos. All the tedious repetition would be handled by the database.

I'd love to do this myself, and I am working on learning C++, but it is not like learning PHP. Also Spring is a complex program.
User avatar
FoeOfTheBee
Posts: 557
Joined: 12 May 2005, 18:26

Post by FoeOfTheBee »

Dragon45 wrote:There is absolutely no reason to use mySQL. mySQL is a relational database and is very powerful as such for crossreferncing and all sort s of funky stuff. Simply put, TA tags andi nformation are flatfile databases, one dimensional. There is absolutely no reason to need mySQL to mod and it would be sheer stupidity.
I agree that MySQL is overkill, but a lightweight rdb would be quite appropriate. TA tags and info have the same structure as tables in a relational database.

Each unit can use weapons
Each unit can build other units
Each unit can have a movement class

So I see at least three tables.

These relationships are represented in flat files at the moment, but the structure is relational.
Last edited by FoeOfTheBee on 02 Jan 2006, 20:35, edited 1 time in total.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Somehow I dont think I'd like continuing with AI if I have to replace all my untiDef data calls with SQL statements
ud->canbuild seems so much easier than something like
sql_query("SELECT canbuild FROM spring_units WHERE id = %i",unit_id);
User avatar
FoeOfTheBee
Posts: 557
Joined: 12 May 2005, 18:26

Post by FoeOfTheBee »

Alantai Firestar wrote:Somehow I dont think I'd like continuing with AI if I have to replace all my untiDef data calls with SQL statements
ud->canbuild seems so much easier than something like
sql_query("SELECT canbuild FROM spring_units WHERE id = %i",unit_id);
I may be clueless here, but doesn't ud->canbuild get information that Spring has already read? I think it would not make a difference if the information were initially read from a tdf file or from a database.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

ooh, in which case I suddenly dont see any advantage whatsoever in loading from an sql databse. Maybe some modders would see an advantage (namely the ones who are already fiddling with SQl databases as we have seen in other threads).

But for the average user I think setting up ODBC in OpenOffice or Access to change unit stats would seem more confusing to them than opening up a file in notepad and changing a value, in most cases it'd be quicker doing it the current way.

Also the wya spring works I think it'd be easier to implement a lua binding or an xml parser than to tie in an SQL engine and change the way everythign operates to suit it.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

I think eventually defining units in a scripting language makes this whole discussion useless anyway....
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

HOLY MOTHER OF GOD you script kiddy dumbshit, you are mixing up DEVELOPEMENT with IMPLEMENTATION.

To DEVELOP your mod, if you want to create some sort of SQL-based app that puts all unit info into a RDB, and then allwos you to pull bunnies out of a hat and edit mod info with OpenOffice so that your mod's penis will be bigger, just go and fucking knock yourself out.

As it is, the current IMPLEMENTATION of the unit information, and how the game engine deals with it, WORKS. It's going to be expanded to work with LUA in the near future, and that'll work EVEN BETTER.

But seriously, just quit all this RDBM talk. Just because you've read Webmonkey's fucking mySQL tutorial or heard the term somewhere on Slashdot doesnt mean that you know jack shit about what the fuck it's actually used for.

Do me a favor; if you still think your fucking RDBM has any merit in Spring's implementation, go drink a cup of

Image
Last edited by Dragon45 on 03 Jan 2006, 01:17, edited 1 time in total.
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

Foe OfTheBee wrote:I'd love to do this myself, and I am working on learning C++, but it is not like learning PHP. Also Spring is a complex program.

Okay, I just read that just now. Do me a favor and never open your mouth again, or you'll let the stupid out.
Locked

Return to “Engine”