Game Development Community

Are compiled scripts cross-platform?

by Jedive · in Torque Game Engine · 03/24/2005 (5:19 am) · 15 replies

Do the same .cs.dso files work on the three supported platforms, opr are they endian-dependent, so I have to compile different .dso files for Win/Linux and Mac?

#1
03/24/2005 (5:50 am)
They are endian dependent.
#2
03/24/2005 (6:07 am)
Oh :( It would be cool if Torque 1.4 used little endian .dso files, also in Mac, so we would share the same compiled scripts in both platforms.
#3
03/24/2005 (7:02 am)
Why not just put the whole package (your game) or just the scripts into a zip file? Most people wouldn't even notice it in there that way. Torque will check inside of zip files.
#4
03/24/2005 (7:18 am)
Wow, this is awesome!

In my game, I have two folders: "common" and "game". I have replaced the "game" folder with a "game.zip" file, and it still loads the stuff correctly!

Thanks a lot, Brian!
#5
03/24/2005 (8:19 am)
Yes, the TAP resource manager will read directly out of .zip files, so that part of the concept works fine.

However, keep in mind that if you distribute .cs files (and you are not allowed to do that with T2D, although it is acceptable with TGE/TSE), you are giving your players access, and the ability to modify, any of the scripts that you have client side.

If you want a completely moddable game, that's not a big deal. If you don't want players messing around with your game mechanics, that is a BadThing(tm).
#6
03/24/2005 (8:36 am)
No, I liked the .zip stuff, but I still don't want to distribute my .cs files, so the problem is still there. The little endian-only .dso stuff is better for that, I think.
#7
03/24/2005 (8:45 am)
Follow up: IIRC, Harold "Labrat" wrote a mod to the resource manager that allows you to encrypt resource "containers" (directories, .zip files, etc.) as a recent resource, or possibly code snippet. You may want to check that out as well, even if it doesn't apply directly to what you are looking for (cross-platform .dso's).

While a cross-platform or target platform .dso compiler would be neat to have, I would suggest that you'll want a Mac in any case for testing your game. There are some very reasonably priced solutions now--the I-Mac Mini runs for around $500 I think, and I know that I personally plan on getting one for this exact reason!
#8
03/24/2005 (9:45 am)
Yeah, I already have an iBook. Gotta check that resource you say, seems pretty interesting.
#10
03/24/2005 (2:16 pm)
DOH! Sorry James, hehe. Information flow on these forums has tripled in the last 3 months--I need a references sheet now to track everything :(
#11
03/24/2005 (2:27 pm)
Quote:However, keep in mind that if you distribute .cs files (and you are not allowed to do that with T2D, although it is acceptable with TGE/TSE)

Actually, that's not entirely right, according to my understanding of the license:
Quote:(e) Licensee may not distribute uncompiled script code which defines any Torque 2D-specific functionality, including but not limited to creating or mainpulating sprites, tiles, particle effects, etc, in any manner, unless recipient also has a license to the Engine.

Emphasis mine.

So you can actually release all the script you want, so long as you don't release anything T2D-specific.

Gary (-;
#12
03/24/2005 (2:42 pm)
Hehe...letter of the law I agree, but I don't see how anyone could write a script file that does all it's work without calling any T2D console methods at all either :) It's possible of course if you specifically write it that way, but that's a lot of work...
#13
03/24/2005 (3:55 pm)
Jugglemaster actually does all of it's work in torquescript completely separately to T2D.

The T2D part of jugglemaster is actually only about 20 lines in client.cs; there's about four thousand lines of code other than that, that is completely independent of T2D :-)

I have every intention of using the same torquescript with TGE at some point.

Gary (-;
#14
03/24/2005 (3:59 pm)
And as to the original part of this thread, I wish that dso's were cross-platform.

Bring on htons, ntohs, htonl, ntohl code.

Gary (-;
#15
03/25/2005 (1:02 am)
Being able to have cross-platform script compiles would be "a good thing"