Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: blowfish on May 17, 2008, 02:29:50 pm
-
OK. School is nearing completion for me, and I'll have a lot of free time this summer (I still have finals this week and I'm going away the next week but after that I'm free). The ship limit (in particular) has really been bugging me, so I figured I might as well take a look at this. Shade said that the best way to do this would be through a linked list. After looking through the parse code, this seems like it would be pretty straightforward with creative use of pointers etc. The question is what to do with that linked list after it is parsed. There are a number of solutions to this problem. One is just to leave the list, and have a new function to look up ships based on index (instead of Ship_info[something] you would use ship_info_at_index(something)). This could potentially create a minor performance drop, however. The second solution would be to create an array of pointers from the linked list and use that to get random access to the list. The third solution would be to copy the linked list into an array and free the memory used by the linked list. This would bump up the parse time a little bit, but I'm not entirely sure it would be noticeable. All three would require changes to everywhere Ship_info[] was used (for the last two, you would have to dereference pointers).
All you SCP guys are probably thinking that I'm forgetting something major. How this integrates with everything else. I know that many things, including the pilot code and multi, are dependent on MAX_SHIP_CLASSES. If that was dynamic, it could cause strange things to happen. This is the area that I don't have very much knowledge about, and also the area that could prevent this whole dynamification project from moving forward anytime in the near future.
So what are your opinions on this? Is it even remotely possible at this point in time?
OK, its not possible ATM. But I am looking to get into SCP and I don't know where to start.
-
*facepalm*
If you need more ships, use an Inferno build. Otherwise, wait for taylor's changes that are coming in 3.7.
-
Otherwise, wait for taylor's changes that are coming in 3.7.
What changes would these be, exactly?
-
*facepalm*
If you need more ships, use an Inferno build. Otherwise, wait for taylor's changes that are coming in 3.7.
All right, I'm sorry. I'm just getting into SCP, and I don't really know where to start. One of the biggest problems I have encountered was probably the first thing that came to mind. Do you have any suggestions for something I could start working on?
-
Nah, that's okay. It's just that this question comes up all the time and the answer is always the same. It's like the FS3 of the SCP, except that you only have to wait for two years instead of for Godot. :p
If you want to start learning the code, take a look at the sexp section, since that's the most organized and easiest-to-follow part of the program.
-
Well, I have already been through large sections of the code, particularly the table code, but I have also looked over the SEXP code once or twice. I am just looking for something that needs doing.
-
You could eliminate the requirement that fighters have secondary weapons. :)
http://scp.indiegames.us/mantis/view.php?id=1278 (http://scp.indiegames.us/mantis/view.php?id=1278)
-
That's another one that sounds easy but isn't.
-
Yeah but at least it's not already slated to be fixed in 3.7. It was more of a joke anyway. But if you do want stuff to do, you could look at other mantis bugs.
-
Otherwise, wait for taylor's changes that are coming in 3.7.
What changes would these be, exactly?
As you saw, many things including pilot code and multi are dependent on this. taylor has been working a long time on a big 'pilot file upgrade' (for lack of a better name), which reaches into so many things and has so many things tied together that it's taking quite a while (understandably so for such a big project). As far as I know, this involves dynamification of limits like:
controls
number of ship classes
max number of primary / secondary banks
number of ships per wing
and surely more. I'm sure looking forward to all that, but can hardly get my mind around the scope of the changes.
I've got quite a few ideas and 'stuff I might want to do someday' type things... perhaps I could suggest a few for you to look into and see if you're interested. Would you like me to PM, or post them here?
-
I've got quite a few ideas and 'stuff I might want to do someday' type things... perhaps I could suggest a few for you to look into and see if you're interested. Would you like me to PM, or post them here?
I'm fine either way :)
-
Post them, so people can chime in if need be.
-
Speaking from a user's standpoint, I do think that Mantis would be a good place to start, as by finding and fixing bugs you can familiarize yourself with what's already in place in a specific area, then tweak it. It will give you more direction than just wandering through the code looking for things to do.
-
Speaking from a user's standpoint, I do think that Mantis would be a good place to start, as by finding and fixing bugs you can familiarize yourself with what's already in place in a specific area, then tweak it. It will give you more direction than just wandering through the code looking for things to do.
I only halfway agree here... while familiarizing yourself with what's already in place in a specific area is a great way to start (it is how I started), many of the bugs in Mantis end up being not so straightforward. It can be hard to find where in the code the bug is actually happening, and you can drown in a vague search. But by all means, if you see one you think you could handle, go for it.
Sorry to leave you hanging, had to go to work. Here we go! First, there's the idea of making Swarm work for primaries. Take a look at the discussion in Mantis #1651 (http://scp.indiegames.us/mantis/view.php?id=1651) for details. Basically you'd be making new routines for primaries, imitating the existing Swarm code for secondaries and/or turrets.
If you want to later tackle something bigger... well, my ultimate goal is to bring us to something like this (http://www.hard-light.net/forums/index.php/topic,53204.msg1075237.html#msg1075237), combined with tertiary weapons. The coolest thing would be for weapons to be able to spawn another weapon as a next 'phase'... this would make my Death Star superlaser idea (http://www.hard-light.net/forums/index.php/topic,53433.msg1080562.html#msg1080562) work, not to mention any other sort of 'charging' weapons. But I can hardly ask you to do all this right away. ;) Unless you really wanted to.
Instead, perhaps start with something somewhat simpler: You know how beam weapons have warmup sounds and intervals before they fire? Add table entries that add this feature for regular weapons, and of course modify the firing functions in ship.cpp . So you'd need four new table entries:
$Warmup
$Warmdown * don't really need this yet, but perhaps later if we add visual effects
$WarmupSnd
$WarmdownSnd
There would be two main modes of weapon firing:
1. The trigger is clicked. WarmupSnd plays and waits for Warmup ms. Now the weapon fires normally, perhaps multiple times according to Spawn settings. (You'd need the primary swarm feature in place for this, but I think to achieve this sort of not-fire-right-away timing you'd need to do something similar to how swarm works anyway.) Then of course when it's done firing WarmdownSnd plays.
2. If the weapon has the "stream" flag, the weapon behaves differently if the trigger is held down: The weapon warms up and fires as above, but continues firing (looping, including the swarm if any) until the trigger is released, then it warms down. Understand?
Some issues that I haven't considered yet would be how it works with the AI and possibly turrets, and also multiplayer. Also, I know Marco on game-warden was looking into the warmupsnd part of this idea as a trigger "weapon thunk" for BSG guns... he might he have some input too.
-
Understand?
Mostly :nervous:
This seems doable enough. I'll see about implementing it (hopefully this week).
-
This seems doable enough. I'll see about implementing it (hopefully this week).
Man, I'm gonna love quoting this out of context. :drevil: