Fallout 2 scripts as java source codes

Tag

First time out of the vault
Fallout 2 scripts as java source codes: http://www.ufonurkka.mine.nu/fallout2scripts.zip.

This baby has almost million lines of code.

p.s. Only game engine implementation is missing. :)

[Edited] Oh and not to discredit anyone. The command opcodes were extracted from teamX's Fallout2 Opcode Playground http://www.teamx.ru/fop/. There wouldn't have been any point of reinventing the wheel. Also some function descriptions were extracted from that project (though translated with babelfish)
 
Tag said:
Fallout 2 scripts as java source codes:

I find this interesting as I used to work for JavaSoft (Sun Microsystems) and I do Java programming every day for wireless handhelds, network devices, databases, web apps, etc.

But I don't see what the point is of having these translated to Java, unless there was a translator that converted the output into Interplay format so they could run on the fallout engine. Or am I missing something?

Tag said:
Only game engine implementation is missing. :)

That's a big missing part :) Are you planning to write an engine in Java? Or some kind of plug-in architecture that runs java code on C based engine? Or what? I love Java, but I'm not sure it will have good enough performance for complex games.
 
I'll take a look at the scripts and if they're good they could be a starting base for the scripts of the IanOut Fallout 2 campaign port :)

At least if Tag allows that ...
 
I started doing this (yet another) fallout engine project as fun offtime project. (I never expect it to finish.) The scripts in fallout 2 are the heart and core of the game. They are the whole content of the game. I did this .int -> .java converter to be able to access much of the content of the game. I figured that even if these sources would never be used anywhere I would still learn a lot about the core of the game. And no, there is no way .java -> .int compiler could be made. The int file format is too constricted.

If you are worried about graphical performance there is no need to. I made some tests and the results were astonishing. It seems that graphical operations (at least in windows VM) are delegated to OS therefore the performance is nearly as good as with lower level languages. As with other performance when combined JIT and modern processors there aren't really problems.

Garbage collector could pose a small problem in real time game but shouldn't be that bad in turn based fallout. Also the time when gc is ran can controlled at some level. First set VM max memory size as high as possible, then force gc to run at convenient points, say when changing map, or entering a dialog.

I've got some amount of code in my CVS. Mostly reading of some file formats. And, I've done some designing of the architecture and requirements. But I may not ever have enough time to finish this (at least alone) so these script-sources are nothing but curiosity at this point... Unless someone else finds them useful in their projects. Java classese can be embedded into c++ applications too.
 
mvBarracuda said:
I'll take a look at the scripts and if they're good they could be a starting base for the scripts of the IanOut Fallout 2 campaign port :)

At least if Tag allows that ...
Yes, go ahead, no arguments here. I think the real question is if Interplay allows it.

Should you use those sources you probably need some kind of wrapper/adapter for your engine. Those ints use exact same commands that fallout 2 uses. There are lots of constant values used in the scripts but you can ignore most of them (almost all). As long as you implement the global var function so that scripts can pass values to each other.

Also the current modders could also be pleased since their scripts can also be recompiled.
 
Tag said:
If you are worried about graphical performance there is no need to. I made some tests and the results were astonishing. It seems that graphical operations (at least in windows VM) are delegated to OS therefore the performance is nearly as good as with lower level languages.

I was doing a bunch of reading on isometic mapping and such a while ago, and found a guy discussing his isometric map rendering in Java. He was doing small things and had performance problems. Although the graphics calls are delegated to OS, you still have a lot of layers of code on top. I'm still skeptical performance wise for something complex, but then I'm not sure anyone has really tried it yet.
 
I was doing a bunch of reading on isometic mapping and such a while ago, and found a guy discussing his isometric map rendering in Java. He was doing small things and had performance problems. Although the graphics calls are delegated to OS, you still have a lot of layers of code on top. I'm still skeptical performance wise for something complex, but then I'm not sure anyone has really tried it yet.

I've seen full screen java game that draws 3000 images with 25fps on 2GHz computer. Now on fallout the tiles can be prerendered in offscreen buffer just like the original game does. This reduces greatly the number of objects drawn. There are only roofs, walls and critters left - a lot less than 1000 images.
 
Hmm interesting .... well I've been doing java programming almost every day since 1.02 a decade ago ... if you get into engine programming I might be able to help out there.
 
dude_obj said:
Hmm interesting .... well I've been doing java programming almost every day since 1.02 a decade ago ... if you get into engine programming I might be able to help out there.

That would be great. In your mind, how much effort are you thinking about dedicating?

My free time comes and goes randomly. If there more igor coders out there I think this project could be very well distributed. It could work out with proper design and management.

There are some entire packages that can be distributed to induviduals.

I have lots of design ideas that could be reviewed by "fresh minds".
 
Maybe I'm to biased as IanOut member; but I don't think that we need another Fallout engine.

The new ianout page will launch April, the second and will have everything (internal forums, cvs system) to make IanOut a multi dev project. There is a new working map converter:
http://ianout.de/iodownloads/foiob01.zip

Feel free to test :) and report the bugs ;) When it's finished it will work for Fallout I AND Fallout II maps :)

So my suggestion is that we should team up. Check out: http://ianout.nma-fallout.com

You can download the latest beta (4.0) there. Beta 5 is on the way, but unfortunately not finished now. :(
 
Well right now I spend as much time working on fallout stuff as I do in my full-time job, if not more. If I thought that a java based engine was doable and a realistic alternative, I'd commit to helping. What I think needs to be done is what I would normally call a "vertical prototype" which tests the key functionality, in this case rendering of an isometric tile layout and map, and some animations, that would sanity test the concept.

If you're serious, I'll work on some java classes that can read the critter.dat and decompress and animate FRM characters. I've done some very interesting java work primarily in embedded/networking areas. I've written java device drivers for industrial equipment and non-standard IO peripherals, code for J2ME embedded device, and much more.
 
So what about marrying the IANOut engine with the Java classes to parse the .int files? (C++ and Java working together...somehow)
The IANOut engine would provide an interface to the Java FO Script core. (and keep its Lua subsystem as well...handy for adding mods to stock FO2)

IANOut handles all the gfx junk in fast C++ (or whatever its coded in), and the FAR slower script specific stuff runs inside the JVM.

Sounds like a good way to waste memory fast, but it should be quick. (considering how crusty Fallout2's engine is, the MMX, SSE, SSE2, 3DNOW, x86-64, ad nauseum... optimizations will make things speedy once again as well as modern use of DirectX or SDL for multiplatform goodness)

Then you have a engine which for all intents and purposes can run Fallout as it was meant to be. (assuming the game functions are RE accurately and act just like Fallout ones)

The ScummVM project seems to have done this (not with the java but the idea seems sound).

I for one feel that modding on the Fallout 2 game engine is a frustrating and slow experience. BUT losing all those mods and other useful tools would harm modders as well.

This could represent the best of both worlds.
 
Mangler said:
So what about marrying the IANOut engine with the Java classes to parse the .int files? (C++ and Java working together...somehow)
The IANOut engine would provide an interface to the Java FO Script core. (and keep its Lua subsystem as well...handy for adding mods to stock FO2)
I (as myself, and not as part of the ianout team ;)) think that this is a good idea. The main problem is that beta 4.9 / 5.0 isn't finished :( So I think it would be the best way to implement some the things into Beta 4.0. The sources are can be downloaded here:
-> http://prdownloads.sourceforge.net/ianout/IanOut-0.8.5.0-Beta-4-Src.zip?download

If it working, it should be no big problem to transform these changes into beta 4.9 / 5. It was our plan to make it a multi dev project anyway and after beta 4.9 all sources file can be accessed via sourceforge cvs.

The main problem would be to find somebody who is willing to write this part of the engine. If you need help compiling the ianout sources, ask me via mail or icq (I'm always 'invisible so don't care to send me a message even if I'm not 'online' ;))
-> mvBarracuda@web.de | icquin: 98600423

You'll need:
-> Visual Studio 2003.net (at least VC++.net 2003)
-> SDL lib
-> SDL image lib
-> SDL mixer lib

Mangler said:
I for one feel that modding on the Fallout 2 game engine is a frustrating and slow experience. BUT losing all those mods and other useful tools would harm modders as well.

This could represent the best of both worlds.
For sure; we have a half working map converter for Fallout 2 here:
http://www.ianout.de/iodownloads/foiob01.zip

Feel free to test it and give feedback :)
 
I assume the IanOut engine can be built with just GNU GCC, this can be done on cygwin or linux yes?
 
Hmmm I'll wait for the 4.9 release then.

Also I hope dude_obj you know something about linking C++ to Java.

I know C++ and Java, but I've never had a need to get one to talk to the other (code level wise).

Also how portable would the resulting program be?
is inter-thread/process message passing the same on Linux as on Windows?!?
 
dude_obj said:
I love Java, but I'm not sure it will have good enough performance for complex games.

While not "extremely" indepth there is a good example of a Java based game here...
http://www.runescape.com/
They have a "free" section and a members section. My gf is addicted and a member, I play once in a blue moon and am also a member.

This is meant for demonstration purposes only! I highly recomend you dont get into this game. I have had tons of problems with the staff from it. They dont care about banning anyone else that is a member nomatter the circumstances. If it dosent effect their cash flow they dont do/fix it. Their customer service is a joke... 3-4 days JUST for a automated response thru their "special" messenger service. You are not alowed any kindsa e-mails to them, or posting aobu tnay kindsa porblems in their forums. SO just use the game to see what kindsa capabilities it would have. I think it would be good... but I'm no expert.
 
Mangler said:
Also I hope dude_obj you know something about linking C++ to Java.

Certainly. I have done JNI bridges that load windows DLLs and or UNIX shared libraries.

Mangler said:
is inter-thread/process message passing the same on Linux as on Windows?!?

I don't think we'd want to be passing thread control through JNI interfaces to C++. Java has its own thread monitor scheme that is not the same. But I can't see why you'd want to pass those kind of references between the two anyways. Game engine and VM control their own thread resources separately. We may need to call methods that cause interrupts and such, but that is not a problem.

EDIT: You can see Java influence in these new FO script commands that I just wrote, API similarity ...

getWeaponProtoNumber(int weaponPID)
getWeaponAmmo(int weaponPID)
getWeaponAnimType(int weaponPID)
getWeaponAnimIndex(int animType)
getWeaponAnimName(int animType)
getWeaponAnimNameList(pointer critterPointer)
getBestCombatSkill(pointer critterPointer)
getCombatSkillName(int skillNumber)
getWeaponSkillGroup(int skillNumber)

pickRandomItem(int itemSubtype, int rollCap)
pickRandomArmor(int armorSubtype, int rollCap)
pickRandomWeapon(int weaponSubtype, int rollCap)
pickUsableRandomWeapon(pointer critterPointer, int weaponSubtype, int rollCap)
wieldRandomWeapon(pointer critterPointer, int rollCap)
checkCritterWeaponAnim(pointer critterPointer, int weaponAnimType)
 
Yeah, I think I meant inter process comunication...

also indeed a simple, JavaFOSVM.haltScript(); thing would do.

So would you be game to build such an interface, dude_obj (or whomever)?
Assuming that FOSVM (FalloutScriptVirtualMachine) works as it should, and Fallout2 does not do any weird things that the VM does not know about making such an interface does not seem that daunting.

Getting it all working corectly with IANOut could be a tricky problem, but seeing as the whole IANOut engine is made to be fallout compatible as possible... I think this can be done.

but what IS the current state of IANOut 4.9?
does it clone all the Fallout functionality such as: combat, barter, conversations, other map interactions, actor scripting, world map?
 
I absolutely love the Java object model. It would be a perfect environment for modelling critters and other game objects. You could do things like iterate through a list of pointers to all critters invoking methods that change their behavior for example. Real OO subtyping of critters and items would be great too. Not that any of this can't be done in C++, it's just so clean and easy in Java. The other thing I love about Java is try/catch exception handling, rather than crashing, the code can be made to be fault tolerant easily. In FO2, if you try to access a global variable outside the index range, the engine crashes. The same is true of many other operations like create object or wield weapon. The game shouldn't just crash if script code is wrong, and with Java that could be nicely wrapped into exception handling code.

Mangler said:
So would you be game to build such an interface, dude_obj

Maybe. A lot depends on what unfolds with IanOut and whether sztupy is even open to this kind of tangent with his engine.

Mangler said:
Assuming that FOSVM (FalloutScriptVirtualMachine) works as it should

I don't see a point in using a name like that because a special VM is not needed, the standard VMs are fine, so it's not a fallout VM, it's just scripting done in Java. One thing to consider might be using one of the J2ME embedded VMs for this. They are very small and not resource heavy, so easy to install/distribute, and you wouldn't want to take away resources from the engine. The code I write on J2ME is no different than J2SE, just a smaller more restricted API, and usually specialized API extensions.
 
Back
Top