Prog&Play, an API to control Spring externally

Prog&Play, an API to control Spring externally

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
Mitmat
Posts: 4
Joined: 25 Feb 2008, 17:26

Prog&Play, an API to control Spring externally

Post by Mitmat »

Hi,

I post in this forum, on advices of zwzsg, to inform the Spring community about my works. I am a Phd student, my subject is focused on serious games dedicated to the strengthening of programming skills. My approach consists in reusing existing games as the basis of a serious game and making it compatible with a maximum of teaching contexts. For my experiments I have chosen Spring and Kernel Panic.

Then I have been developing a library called Prog&Play that enables players to build a program (currently Prog&Play is available in C, C++, Java, Ada, OCaml and Scratch) in order to interact with the game. Through this library, player can load game data like unit features (number, position, type...), map size, etc. and give orders to his/her units.

Additionally, I have been developing a campaign for Kernel Panic here. In this campaign, the mouse is locked, and the player has to control units using programming. The goal is to introduce progressively computer programming concepts like sequence, conditional and iterative control structure, etc.

You will find my Spring source code modifications here (currently based on 80.5.2). To easily find my modifications, search "muratet" in files. Perhaps you will be interested to consider my modifications for a future version of Spring.

For more informations on my works you can visit my web pages here.
Last edited by Mitmat on 17 Oct 2011, 12:15, edited 3 times in total.
0 x

User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Re: Prog&Play, an API to control Spring externally

Post by SinbadEV »

This sounds like a rather clever idea. Please let us know how it works out... I cut my Internet teeth in a MOO (basically a social MUD without the violence where you programmed rooms, character traits and objects etc... I remember one time implementing hit points and alive/dead status that would allow other people to use violent verbs on me to damage me... I forget if I got in trouble for that... at the time I was on very good terms with the Wizards so I think they let it pass... I also extended the pet object to act as a bug I could place in private chat areas... and then use to talk to people... which would freak them out.) so can appreciate the idea of tricking kids into learning to program... though if you don't include an intuitive IDE you can die in fire.

(note, the thing about "dieing in fire" was meant ironically and is a reaction to the fact that the programming environment in the MOO I described was draconic and evil.)
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14637
Joined: 17 Nov 2005, 02:43

Re: Prog&Play, an API to control Spring externally

Post by Forboding Angel »

This is neat. Reminds me of some other games I've seen. I'm impressed that you've accomplished all this though. Sadly, I myself can't really program my way out of a paper bag (unless you count php), however there are some people here (Lurker, where are you?) who would dig the hell out of this. Neat concept, cheers! :-)
0 x

User avatar
hoijui
Former Engine Dev
Posts: 4343
Joined: 22 Sep 2007, 09:51

Re: Prog&Play, an API to control Spring externally

Post by hoijui »

could you possibly make your spring engine changes available through git? this would like.. quatripple the chance of them being included in spring master (or at least for the changes to be checked through by spring devs).
if you do not know git, it should be easy to find guides or tutorials online, there are really good ones, and differentiated ones, for different type of learners.
0 x

Mitmat
Posts: 4
Joined: 25 Feb 2008, 17:26

Re: Prog&Play, an API to control Spring externally

Post by Mitmat »

Certainly, I will make up my changes through git, moreover it would be occasion to insert my modifications in the latest spring version.

But I have a question, because in my current version 0.80.5.2, I use hardcoded (start) scripts and I have understanding this functionnality have been removed in latest spring engine version. However, I notice this part of code is always included in 0.81.2.1 source code.

So, would you prefer I make up my changes in spring master code (without hardcoded script) or in latest release 0.81.2.1 (with hardcoded spript)?

Other question, how can I download latest release code (0.81.2.1) with ".git" files?
0 x

SeanHeron
Engines Of War Developer
Posts: 583
Joined: 09 Jun 2005, 23:39

Re: Prog&Play, an API to control Spring externally

Post by SeanHeron »

The hardcoded startscripts are going to be axed with the next major Engine release - that's why they're still in the latest release.
So yeah, integration into the master code would be the way to go, I think (I'm not actually an Engine Dev, so don't nail me down on this).

Well spotted, by the way :).
0 x

Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Prog&Play, an API to control Spring externally

Post by Tobi »

Aww, so it was used anyway. I hope it won't cause too much problems then to port your modifications over to new versions.
Mitmat wrote:So, would you prefer I make up my changes in spring master code (without hardcoded script) or in latest release 0.81.2.1 (with hardcoded spript)?
In the long term master would be better (because that's ultimately what the next major release will be based on), but it may not be easy to automatically merge changes in master to the 0.81.2 release series.
Other question, how can I download latest release code (0.81.2.1) with ".git" files?
If you have a git clone already, you can checkout the latest release code using:

Code: Select all

git checkout 0.81.2.1
(it's a tag)

Or you can make a branch based on this tag:

Code: Select all

git branch mybranch 0.81.2.1
git checkout mybranch
0 x

Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Prog&Play, an API to control Spring externally

Post by Auswaschbar »

I have seen this, it basically reproduces features already in lua. Would it really add any benefit for spring master?
0 x

Mitmat
Posts: 4
Joined: 25 Feb 2008, 17:26

Re: Prog&Play, an API to control Spring externally

Post by Mitmat »

I have seen this, it basically reproduces features already in lua. Would it really add any benefit for spring master?
Indeed, it is the question that you (spring community) have to answer :wink: .

I can just explain why I have been developing the Prog&Play API instead of using Lua. There are two reasons:
1 - During my Phd thesis, I have been confronted to the following problem: how test a serious game based on a RTS to teach programming in several contexts (differents students, teachers, institutions...)? The first solution is to give a serious game with a specific programming language but teachers who make the choice to use an other programming language for personnal pedagogical reasons don't want to change their teachings to use the serious game. So, I made the choice to give a serious game compatible with several programming languages, and I carried out currently 3 experiments with Caml, C and Java.
2 - In order to simplifying game manipulation, (certain students never played RTS... yes yes it's true :-) ). Students run the game or a mission and can edit his/her program and execute it dynamically without stop and restart the game or type "/luaui reload" command.
0 x

User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7024
Joined: 16 Nov 2004, 13:08

Re: Prog&Play, an API to control Spring externally

Post by zwzsg »

2) You don't have to type /luaui reload to reload a widget. Personnaly I just go through the F11 list and mouse-click to disable then renable the widget I'm testing. But you could have a Lua widget that disable and re-enable other widgets! You could also bind a shorctut key to luaui reload through uikeys.txt.
0 x

User avatar
hoijui
Former Engine Dev
Posts: 4343
Joined: 22 Sep 2007, 09:51

Re: Prog&Play, an API to control Spring externally

Post by hoijui »

hmm..
from these two points alone, it seems not to make any sense indeed.
The AI Interface is already multi-language, and AIs can be reloaded through /aireload, or you can use eg. groovy or jruby scripts running on the Java AI Interface, which can be made to auto reload on source file change.
I do not know about the Lua AI stuff, but what zwzsg said sounds like it also has all that already.
0 x

Post Reply

Return to “Engine”