Squirrel Discussion

Discuss the development of Reality Factory 2
User avatar
paradoxnj
RF2 Dev Team
Posts: 1328
Joined: Wed Mar 01, 2006 7:37 pm
Location: Brick, NJ
Contact:

Squirrel Discussion

Post 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);
    }
}
Many Bothans died to bring you this signature....
User avatar
ardentcrest
Posts: 735
Joined: Wed Jan 25, 2006 10:55 pm
Location: Ireland

Re: ActionMap Concept

Post 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 :wink:
He's a Bot Jim, But not as we know It.
User avatar
paradoxnj
RF2 Dev Team
Posts: 1328
Joined: Wed Mar 01, 2006 7:37 pm
Location: Brick, NJ
Contact:

Re: ActionMap Concept

Post 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).
Many Bothans died to bring you this signature....
Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Re: ActionMap Concept

Post 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.
Everyone can see the difficult, but only the wise can see the simple.
-----
User avatar
paradoxnj
RF2 Dev Team
Posts: 1328
Joined: Wed Mar 01, 2006 7:37 pm
Location: Brick, NJ
Contact:

Re: ActionMap Concept

Post by paradoxnj »

It's just the class syntax that looks like Java. Squirrel does not behave nor is it's design anything like Java.
Many Bothans died to bring you this signature....
User avatar
ardentcrest
Posts: 735
Joined: Wed Jan 25, 2006 10:55 pm
Location: Ireland

Re: ActionMap Concept

Post 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
He's a Bot Jim, But not as we know It.
User avatar
paradoxnj
RF2 Dev Team
Posts: 1328
Joined: Wed Mar 01, 2006 7:37 pm
Location: Brick, NJ
Contact:

Re: ActionMap Concept

Post by paradoxnj »

It is not a complete rewrite. Integration took less than 1 week.
Many Bothans died to bring you this signature....
User avatar
ardentcrest
Posts: 735
Joined: Wed Jan 25, 2006 10:55 pm
Location: Ireland

Re: ActionMap Concept

Post by ardentcrest »

Been reading up on Squirrel. Seems easyer then python. It has my vote.
He's a Bot Jim, But not as we know It.
User avatar
ardentcrest
Posts: 735
Joined: Wed Jan 25, 2006 10:55 pm
Location: Ireland

Re: ActionMap Concept

Post 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
He's a Bot Jim, But not as we know It.
User avatar
paradoxnj
RF2 Dev Team
Posts: 1328
Joined: Wed Mar 01, 2006 7:37 pm
Location: Brick, NJ
Contact:

Re: ActionMap Concept

Post by paradoxnj »

It is written by the guy who did the scripting for FarCry (Alberto Demichelis).
Many Bothans died to bring you this signature....
Allanon
Posts: 493
Joined: Mon Aug 29, 2005 8:23 am

Re: Squirrel Discussion

Post 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.
User avatar
paradoxnj
RF2 Dev Team
Posts: 1328
Joined: Wed Mar 01, 2006 7:37 pm
Location: Brick, NJ
Contact:

Re: Squirrel Discussion

Post 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.
Many Bothans died to bring you this signature....
Danimita92
Posts: 335
Joined: Sat Feb 09, 2008 5:47 pm
Location: Lanzarote/Canary Islands/Spain

Re: Squirrel Discussion

Post by Danimita92 »

squirrel actually looks like the scripting system the original RF has (although I know nothing about programming
User avatar
psychopath
Posts: 32
Joined: Wed Jul 13, 2005 4:05 am
Location: Where circles begin.
Contact:

Re: Squirrel Discussion

Post 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.
User avatar
paradoxnj
RF2 Dev Team
Posts: 1328
Joined: Wed Mar 01, 2006 7:37 pm
Location: Brick, NJ
Contact:

Re: Squirrel Discussion

Post 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.
Many Bothans died to bring you this signature....
Post Reply