Hard Light Productions Forums

Hosted Projects - Non-FreeSpace => StarShatter Open Source Project => Topic started by: The E on May 28, 2012, 03:04:37 pm

Title: Starshatter modding tools
Post by: The E on May 28, 2012, 03:04:37 pm
First up, a new version of datafile.exe (the more powerful version of modfile.exe) has been uploaded to the google code page (http://code.google.com/p/starshatter-open/downloads/list).

This version doubles the previously existing limit of 4096 files per archive, thus allowing bigger archives to be created.

Do note that this is a command-line utility, and is NOT a drop-in replacement for modfile.exe; to use this, you have to change createmod.bat to this:
Code: [Select]
datafile.exe MyMod.dat -mak
Further usage notes:
Code: [Select]
Usage: datafile <dat-file> -option <file list>
options:  -ins  (insert files into datafile)
          -ext  (extract files from datafile)
          -del  (delete files from datafile)
          -mak  (insert all files in current directory and all subdirectories)
          -list (display list of entries in datafile)
Title: Re: Starshatter modding tools
Post by: braddw25 on May 28, 2012, 07:31:16 pm
Very interesting. I'm a bit embarrassed to admit that I never knew there was a 4096 file limit. Very cool that you were able to overcome that limitation E. Nice work. I'm trying to learn a bit about C++ so I can help out with the coding project. Its going to be a learning curve for me though. The last programming I did was with BASIC on an appleIIgs.
Title: Re: Starshatter modding tools
Post by: The E on May 29, 2012, 03:08:43 am
That part was rather simple. Getting the thing to run properly, that was the challenge; this utility was written back in the early days of Starshatter development, when the Windows SDK was looking rather different.
Title: Re: Starshatter modding tools
Post by: Dragon on June 17, 2012, 11:36:50 am
Is there any complete, self-contained modding guide to Starshatter? Sort of like Karajorma's Freespace FAQ, just a bit more up to date. I'm just getting into this game and while it's amazing (it has a lot of things I wanted to implement into FS2, including Newtonian flight model and capship command), it's lacking in some fields. It would also be great if there was some mod database that would work (Google returns either HLP, or Starshattermods, the latter of which gives me a 404).
Overall, I think this game has a lot of potential if given the same treatment as FSO.
Title: Re: Starshatter modding tools
Post by: braddw25 on June 17, 2012, 11:50:02 am
Dragon,

If you go to www.spacesimcentral.com in the download area under Starshatter and then in the utils folder there are two downloads that will at least get you started. One is called mod sdk and the other is called modders toolkit. If you have any question at all, feel free to ask and I will do my best to answer them or at least get you an answer if can't answer myself.. Welcome to the Starshatter modding community!
Title: Re: Starshatter modding tools
Post by: Dragon on June 20, 2012, 04:52:20 pm
OK, first question. Where can I find a mod which I could take apart and see how it's done? I've read the docs, but I'd like to see example configs, perhaps a working ship model and effect bitmaps.
Also, what's npp.5.6.4?
Title: Re: Starshatter modding tools
Post by: rscaper1070 on June 20, 2012, 11:51:16 pm
The same place (http://www.spacesimcentral.com/downloads/ft2.php?dir=/Starshatter_TGS), under shipfleetmods. I don't know how he did it but braddw25 uploaded all those files. Wdboyd's Solcom mod is a good one to check out. He put together a lot of different kinds of ships and his def files are very helpful to look at.

npp.5.6.4? No clue.
Title: Re: Starshatter modding tools
Post by: The E on June 21, 2012, 12:59:29 am
Notepad++ 6.5.4, at a guess.
Title: Re: Starshatter modding tools
Post by: MatthTheGeek on June 21, 2012, 02:50:33 am
OK, first question. Where can I find a mod which I could take apart and see how it's done? I've read the docs, but I'd like to see example configs, perhaps a working ship model and effect bitmaps.
Can't you just use retail data ?
Title: Re: Starshatter modding tools
Post by: jr2 on June 21, 2012, 04:11:32 am
Notepad++ 6.5.4, at a guess.

That was my guess, but I hesitated offering it as I didn't want to seem foolish if there was some SSMods util with the initials npp :nervous:
Title: Re: Starshatter modding tools
Post by: The E on June 21, 2012, 04:58:42 am
OK, first question. Where can I find a mod which I could take apart and see how it's done? I've read the docs, but I'd like to see example configs, perhaps a working ship model and effect bitmaps.
Can't you just use retail data ?

That's pretty much what I would do. Unlike retail FS2, there's not that much hardworking going on, so a lot of data is modifiable through def files.

I am going to post a few rough guides on what folder contains what, and definitions for the various def files soon.

Note: if you do end up extracting the retail files, you need to extract shatter.dat first, then content.dat. Then copy the files from content.dat into the same directory as the files from shatter.dat, and overwrite any conflicting files.
Title: Re: Starshatter modding tools
Post by: Dragon on June 21, 2012, 08:37:18 am
How can I extract .dat files? You mentioned modfile.exe, but I don't know where to find it.
Also, is there a model viewer similar to PCS2?
Title: Re: Starshatter modding tools
Post by: rscaper1070 on June 21, 2012, 11:07:41 am
You need to use the Starmod.exe to open and extract dat files. Magic 2.0 is what you can use to view models.
Title: Re: Starshatter modding tools
Post by: The E on June 21, 2012, 11:11:06 am
Using modfile.exe is not recommended. In the latest download available on google ( http://code.google.com/p/starshatter-open/downloads/detail?name=Starshatter%205.1.66.7z&can=2&q= ) you will find datafile.exe, which does the same job, but better.
Title: Re: Starshatter modding tools
Post by: Dragon on June 21, 2012, 01:52:31 pm
Is there any chance we'll get a GUI tool that would replace the datafile.exe (or just a GUI overlay for it)? I don't feel like messing with the command line interpreter every time I want to extract something.
Also, where can I find Starmod.exe?
Title: Re: Starshatter modding tools
Post by: The E on June 21, 2012, 02:19:55 pm
Quote
Is there any chance we'll get a GUI tool that would replace the datafile.exe

Not from me. If someone wants to write one, I'd be happy to include it, but since the things that a normal user would need to do (decompressing a .dat/creating a new .dat) can be done with a few simple commands, I won't be putting effort into it.

For reference, the commands needed are:
To extract, use
datafile.exe <.dat filename> -ext

And to create a new archive use
datafile.exe <filename of the new archive> -mak
Title: Re: Starshatter modding tools
Post by: Dragon on June 21, 2012, 02:39:39 pm
Hmm, I found this Starmod.exe and it seems to work just like VPview. What's the difference between it and datafile.exe (other than the former having a proper GUI)?
Title: Re: Starshatter modding tools
Post by: The E on June 21, 2012, 03:10:33 pm
Since I don't have the source for starmod, I can't tell you. I do suspect, however, that it will suffer from the same limitations as modfile.exe and old versions of datafile.exe (modfile being a dumbed-down version of datafile), namely the inability to create archives with more than 4096 files.
Title: Re: Starshatter modding tools
Post by: Dragon on June 21, 2012, 05:23:22 pm
A command line tool for making packs is fine, and Starmod seems to work for extracting. I guess that's it for now.
Title: Re: Starshatter modding tools
Post by: jr2 on June 24, 2012, 11:15:38 pm
Would it be easier for someone to make a Front-end for the command line tool?  I know I use D-Fend for DOSBox and I've used several other frontends before (for Contig, and MediaCoder is just one big frontend for a bunch of tools).
Title: Re: Starshatter modding tools
Post by: Dragon on June 27, 2012, 05:19:40 pm
OK, what exactly is the polygon limit for Starshatter ships. Also, a tutorial to converting FS models to Starshatter could come in very handy in the future.
Another thing I'd like to know is if there's anything in SS that could limit potential ROF of a gun. Would that be possible to ramp it up to realistic levels (TBH, I found stock guns rather pathetic)?
Title: Re: Starshatter modding tools
Post by: rscaper1070 on June 27, 2012, 05:26:16 pm
The poly limit is governed by Magic, which is 16k, but you can cut up the model into detail parts and SS will put them together. I'll try and put together a tutorial of converting models soon. And yes you can govern the ROF by changing refire delay or recharge rate in the weapons def.
Title: Re: Starshatter modding tools
Post by: Dragon on June 27, 2012, 05:56:03 pm
I know I can try ramping up the ROF. The question is, just how much? For example, I'd like to have a cannon that fires at 6000 rpm (about what you can get from Real Life M61 Vulcan cannon). In FS, this is very difficult to get working and requires a split second lifetimes, thus limiting the range. Now, think that it's mounted on all fighters and most capships have at least two. I'd like to know if SS would be capable of handling this kind of load.
Title: Re: Starshatter modding tools
Post by: light_gemini on June 28, 2012, 09:35:10 am
Just tried modding vanguards to fire 6000 rpm (0.01 refire delay), and 8 of them on battle firing nonstop caused no lag for me. Vans were firing to targets up to 50km with unlimited power.
Hope thats a good begining.
Title: Re: Starshatter modding tools
Post by: MatthTheGeek on June 28, 2012, 10:05:37 am
You'd still have to make sure they do fire at 6000rpm ingame. I wouldn't be surprised if the engine automatically clamped the fire rate to something slower. Best way for that would be to check if they deal damage at the rate they're supposed to.
Title: Re: Starshatter modding tools
Post by: light_gemini on June 28, 2012, 04:21:22 pm
As far as I see theres no limit in the code expect "0". The limit should be on other factors I cannot exactly tell   (fps, cpu?, accuracity of time measuring?,game exec. time steps?, engine crash?)
Title: Re: Starshatter modding tools
Post by: MatthTheGeek on June 28, 2012, 04:39:29 pm
Add to that some stuff as object limit, projectile limit, collision pair limits... If SS has any such hardcoded limits that is.
Title: Re: Starshatter modding tools
Post by: Dragon on June 28, 2012, 07:16:44 pm
Add to that some stuff as object limit, projectile limit, collision pair limits... If SS has any such hardcoded limits that is.
Well, that's about what I was asking about. Are there any hardcoded limits that I could hit when trying to make things realistic?
For such an old game, Starshatter seems conspiciously devoid of obvious hardcoded limitations.
Title: Re: Starshatter modding tools
Post by: MatthTheGeek on June 29, 2012, 01:02:35 am
Such an old game ? Wut. It's an '06 game.

In HW2 ('04), most of the limits I mentionned above are definitely dynamic (never managed to get the game to crash with a recursive self-spawning cluster missile, for example).
Title: Re: Starshatter modding tools
Post by: Dragon on June 29, 2012, 05:37:07 am
Well, I admit I don't have that much experience with modding games from that era (I mostly work with antique titles such as FS2 or Freelancer). Anyway, I'd like to know if there's anything except computer performance that would prevent realistic ROFs from being feasible. It seems like there's no such thing, but I'm still not sure.
Title: Re: Starshatter modding tools
Post by: The E on June 29, 2012, 06:06:35 am
Add to that some stuff as object limit, projectile limit, collision pair limits... If SS has any such hardcoded limits that is.
Well, that's about what I was asking about. Are there any hardcoded limits that I could hit when trying to make things realistic?
For such an old game, Starshatter seems conspiciously devoid of obvious hardcoded limitations.

Most of the things that are in Starshatter  are very definitely dynamic. Starshatter is coded in such a way that it utilizes a lot of the stuff introduced into C++ in the past few years to make things as dynamic as possible; while I believe that there are still hardcoded limits in places (like the max number of debris pieces, or the maximum number of campaigns), making them dynamic should involve less headaches than the same process in FSO.

That being said, however, always realize that you're making a game, not a 100 % accurate simulation of reality. Even if someone says "I tested this, and it caused no lag on my machine", it doesn't mean anything. Especially when you intend to spawn several thousand collision-enabled objects into the mission space. Always ask yourself, "How can I get the same result using less ressources", if we take the example of a gatling gun, then the only things the player will be able to experience are the sound of the gun, and the tracer bullets. If we take a 6000 rpm gun, and assume that every tenth bullet is a tracer, why not just use a 600 rpm gun effect with a 6000 rpm sound effect?
Title: Re: Starshatter modding tools
Post by: Dragon on June 29, 2012, 06:52:07 am
Of course, 6000 rpm was just an example figure I gave. On the other hand, I would like to make it as realistic as possible (unlike in FS, this should be possible in SS). It might turn out that the CIWS would need it's absurd ROF for exactly the same reasons as real systems do (also note that, at least in FS, there's a noticeable visual difference between 6000 rpm impacts and 600 rpm impacts, though this could be worked around). While it won't be FreeFalcon (at least not now), I'd like to bring it as close to a simulator as possible (though it's not like there won't be any balance). Of course, this would mean that it might have rather high system requirements. Anyway, good to hear about dynamic limits. I'll try not to go too overboard with them.
Title: Re: Starshatter modding tools
Post by: The E on June 29, 2012, 07:44:51 am
Somehow, I think you missed what I was getting at.

The problem is this: throwing several thousand objects, even short-lived ones, with collision detection enabled into a mission space is a bad idea. ALWAYS. Now, granted, Starshatter is better at coping with this than FSO, but one should nevertheless strive to cut corners wherever possible. The thing about the 600rpm/6000rpm idea was to only generate objects that the player can actually see, and leave the rest out of the equation. Also note that, by making the bullet objects larger than necessary, you can fudge the interception factor by quite a margin.


Also, realism? In a game that features FTL jumps and manned combat starships?
Granted, SS goes heavily into realism, but errs on the side of being a game in most cases. Taking real-world specs, and translating them 1:1 into the game is NOT a good way to start.
Title: Re: Starshatter modding tools
Post by: Dragon on June 29, 2012, 09:27:02 am
Note, my trick for reducing the performance impact of high ROF cannons is to clip their lifetime and increase velocity. Talking real world muzzle velocities and accuracy, the lifetime should be manageable. My idea is to cut rounds off at a range at which the vast majority of them will miss the intended target anyway. Since CIWS systems are AA weapons, the range won't be all that great. Same with fighter cannons, which would have an added bonus of not being used too often, and in very short, controlled burst. IRL, it only takes a few solid gun hits to down a plane (getting them, on the other hand, is quite a challenge).

Regarding realism of FTL jumps and starships, I already have an idea for this (actually, it's the fighters that are the hard part, warships are easy to justify). Ideally, I'd be able to do a mod outside of SS universe, but since that's a long way off, I'll start with smaller things.