Page 1 of 3
Squirrel Discussion
Posted: Mon Jan 26, 2009 3:37 pm
by paradoxnj
IMHO, Squirrel is much "lighter" than Python is. It is also more flexible. I like the script syntax better. For example, to create a game object using Squirrel, all you do is the following:
Code: Select all
// Simple bomb entity
class Bomb extends RF2GameObject
{
timeToExplode <- 5; // 5 seconds to explode
lastTime <- 0;
function constructor()
{
// initialize the bomb
setMesh("bomb.mesh");
setMaterial("entities/bomb");
RF2GetGame().scheduleEvent(this, "explode", 5000, false); // Instruct the shell to call the explode function in 5000 ms and don't repeat it.
}
function explode()
{
// Tell the shell to add an explosion object at the position of the bomb, use bombdebris.mesh as the debris and leave the debris for 3 seconds
RF2GetGame().getWorld().addExplosion("bombexposion", getPosition(), "bombdebris.mesh", 3000);
}
}
Re: ActionMap Concept
Posted: Mon Jan 26, 2009 5:41 pm
by ardentcrest
It does look much cleaner then python.
So been "lighter" than Python is and more flexible, is it also faster.
I'm going to put a hold on learning python till you and Andy pick the best script that will be in RF2
Hope you pick one soon. and cant wait to see the demo
Re: ActionMap Concept
Posted: Mon Jan 26, 2009 6:23 pm
by paradoxnj
I'm gonna be a little late with the demo. Had 2 sick kids and lost some time. I am shooting for Valentine's Day (Feb 14th).
Re: ActionMap Concept
Posted: Mon Jan 26, 2009 7:55 pm
by Jay
Squirrel looks a bit like Java. No problem, i have gotten used to Java and i like it (we are currently using it in university). Java now even is my nr.1 language (i particularly like that extends and interface idea, instead of abstract classes in c++, i also like that everything in Java is essentially an Object or can be converted into one)! Squirrel looks definitely better than Python.
Re: ActionMap Concept
Posted: Mon Jan 26, 2009 8:56 pm
by paradoxnj
It's just the class syntax that looks like Java. Squirrel does not behave nor is it's design anything like Java.
Re: ActionMap Concept
Posted: Mon Jan 26, 2009 9:04 pm
by ardentcrest
If It doesnt mean a complete rewrite of the RF2 code maybe Squirrel is the way to go.
AIM look like a nice prog. most time I'm on Messager
Re: ActionMap Concept
Posted: Mon Jan 26, 2009 9:05 pm
by paradoxnj
It is not a complete rewrite. Integration took less than 1 week.
Re: ActionMap Concept
Posted: Mon Jan 26, 2009 9:08 pm
by ardentcrest
Been reading up on Squirrel. Seems easyer then python. It has my vote.
Re: ActionMap Concept
Posted: Mon Jan 26, 2009 9:39 pm
by ardentcrest
Free Software
* irrEdit 3D scene graph editor, allows user written squirrel scripts to be executed in it to extend its functionality.
* Ultima IV Multiplayer The Quest of the Avatar, a ground-breaking game released almost 20 years ago, now re-invented for a multi-player experience.
* Liberty Unleashed Liberty Unleashed is an online multiplayer mod for GTA3
Commercial Projects
* Final Fantasy Crystal Chronicles: My Life as a King (Square-Enix, Nintendo Wii)
* IL-2 Sturmovik: Birds of Prey
* X-Blades
* Streets of Moscow
nice, nice, nice
Re: ActionMap Concept
Posted: Mon Jan 26, 2009 9:44 pm
by paradoxnj
It is written by the guy who did the scripting for FarCry (Alberto Demichelis).
Re: Squirrel Discussion
Posted: Tue Jan 27, 2009 10:28 am
by Allanon
I don't know anything about Squirrel so I'm not going to judge but I have been using Python and what I think makes it a very good scripting language is all the libraries. You name it and someone has already written a library for what you want to do, other not so well know scripting languages don't have these kind of resources.
Re: Squirrel Discussion
Posted: Tue Jan 27, 2009 2:35 pm
by paradoxnj
That is also what makes it "heavy". We were using Python as a DLL and when the EXE was compiled for RF2, it was 3MB in size. I have Squirrel compiled static along with SqPlus and DXSquirrel and the EXE is only 1.5MB. Python is also slow when calling Python functions from C++. Squirrel is made for that. Python syntax is ugly...one tab out of place and your script don't work. Try having a novice troubleshoot that. Both languages have good binding code (Boost::Python and SqPlus).
For game development, you don't need 95% of the community developed libraries that are out there for Python. You just need your game shell's script exports.
Re: Squirrel Discussion
Posted: Wed Jan 28, 2009 4:40 pm
by Danimita92
squirrel actually looks like the scripting system the original RF has (although I know nothing about programming
Re: Squirrel Discussion
Posted: Thu Jan 29, 2009 7:30 pm
by psychopath
Python is also slow when calling Python functions from C++
Typically, wouldn't we only be calling C++ functions from Python? The only reason I can think of why you'd need to call Python from C++ would be if you intended on having a main entry-point function.
Re: Squirrel Discussion
Posted: Thu Jan 29, 2009 9:50 pm
by paradoxnj
When you setup an event based gameshell, you need to be able to supply custom event handlers. This is the case where C++ would be calling Python functions. You are talking about exported functions.