GGE

Published January 24, 2007
Advertisement
So I don't know what is going on with GGE. I applied for a beta invite about three or four weeks ago now and never got an email.

I went back on (via the GDNet link this time) and tried to set up another account today and it told me an account already exists with my email address.

So I sent a comment via the contact page to the effect that I was very interested in participating but couldn't if they didn't let me in, and have so far heard nothing.

Oh well. I want those cool badge things at the top of my journal [sad].

Other than that, it looks like maybe me and my girlfriend could be splitting up and I'll have to give up owning a car. Whatever happens, I have to make sure I can continue to afford the internet, or I'll go mad.

Udo
Deciding against the whole complex virtual-machine-based scripting system at the moment since I think it is not needed and may produce too much overhead (more in terms of code complexity than running speed).

It's a bit of a thinker because on the one hand all I want to do with scripts at the moment is control when enemies get activated, which would currently be purely by the player passing certain points, but on the other hand I have no idea what else I might want to use scripting for in the future.

This, I guess, is why you should design your projects first instead of just making them up as you go along like I do.

I'm thinking about ripping off Sir Sapo's system for Angels 22 and having like a line-per script [condition][action] sort of system, then hardcoding instructions for like PLAYERXGREATERTHAN rather than have a vm that can actually do proper maths.

Who knows. I don't. I'm a bit too depressed to approach design of a whole new module for Udo at the moment, but progress is sort of halted until I make a decision and implement scripting of some kind so that's not good.
Previous Entry Depressed
Next Entry Scripting
0 likes 7 comments

Comments

Programmer16
If you don't hear back from them I still have my two invites if you want one.
January 24, 2007 02:25 PM
Aardvajk
Quote:Original post by Programmer16
If you don't hear back from them I still have my two invites if you want one.


Cheers. I've PM-ed you about that.
January 24, 2007 02:31 PM
Jesse Chounard
I really recommend going with something like Lua or Python. Lua is dead simple to embed into C++. I've done it both with and without Luabind, which makes things even easier.

Unless, of course, you'd like to write your own scripting system for the learning experience. In that case, go nuts. :)
January 24, 2007 02:50 PM
Jotaf
Hey good luck with your gf and your car. I've got a friend who's kinda in the same situation, and he's already lost his cellphone and internet connection. It sucks =/

About the game: a less fancy way of doing what you want is with invisible objects that pass messages around. For example, in the editor you can link an object that detects when the player is near it to a monster's "show up" slot; when it fires, the monster shows up.

All that this means in terms of functionality is that every object has a common "handle_signal" function that accepts a slot ID as its only parameter. When the invisible object sees the player, it tells the linked object to do its thing:

linked_object->handle_signal(slot_id);

...or something like that :)
It's much easier done than said. Anyways the good thing is that it's immensely scalable, you can come up with all kinds of constructs if you want, but keep it simple like that if you don't, and it goes well with a graphical editor. There's someone here in journal-land making a game with a cow that uses this system :P
January 24, 2007 04:38 PM
Sir Sapo
Once I'm done cleaning up and commenting my scripting source code, I'd be glad to post it if you want to see how I did it. I'm sure its not the best way to do it, but at the very least you can see how not to do it[wink]
January 24, 2007 05:02 PM
Todo
If I may make a few simple suggestions (just to make sure you don't get stuck in a what-to-do-next craze): lots and lots of games make use of drop-dead easy scripting languages that take no more than a regex or even a strtok to implement. I can name a dozen, and I'm sure there are tons more:

1) Dungeon Keeper dates back as far as 1997 and featured some great means by which you could mod the game (albeit thanks to some clever hacking too). Here a sample level script:


REM this is a BASIC style comment
REM Level 139 (level1)

START_MONEY(PLAYER0,2500)

ADD_CREATURE_TO_POOL(FLY,3)
ADD_CREATURE_TO_POOL(BUG,12)

ROOM_AVAILABLE(PLAYER0,TREASURE,1,1)

REM display some tutorial text when we've run for 125 game ticks
IF(PLAYER0, GAME_TURN > 125)
	DISPLAY_INFORMATION(1,PLAYER0)
ENDIF

REM if the player lures his first creature into his dungeon, give him the
REM ability to built a lair
IF(PLAYER0,TOTAL_CREATURES >= 1)
	IF(PLAYER0,TREASURE >= 9)
		ROOM_AVAILABLE(PLAYER0,LAIR,1,1)
	ENDIF
ENDIF

REM this is the interesting tidbit: add two tunnelers (diggers) when +-13
REM minutes have gone by and a certain condition is met
REM one of the numbers supplied to the ADD_XXX_TO_LEVEL command define a hotspot
REM somewhere in the level (carefully placed by the level designer)
REM *** HAS EIGHT OR MORE CREATURES ***
IF (PLAYER0, FLAG0 == 5)
	IF(PLAYER0,TIMER1 >= 800)
		ADD_TUNNELLER_TO_LEVEL(PLAYER_GOOD,1,DUNGEON,0,1,200)
		ADD_TUNNELLER_TO_LEVEL(PLAYER_GOOD,1,DUNGEON,0,1,200)
		REM next step: another enemy party
		SET_TIMER(PLAYER0,TIMER2)
		SET_FLAG(PLAYER0, FLAG0, 6)
	ENDIF
ENDIF

REM after the first battle has been won, add an enemy party to the level
REM *** HAS WON FIRST BATTLE ***
IF (PLAYER0, FLAG0 == 6)
	IF(PLAYER0,TIMER2 >= 500)
		IF(PLAYER0,TOTAL_CREATURES >= 7)
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,KNIGHT,1,1)
		ENDIF
	ENDIF							
ENDIF								


2) Netstorm is another example, that made it easier in terms of scripting. It used a combination of the Windows configuration file syntax and HTML code to alleviate on parsing yielding something like this:


[ai1PriestDead]
<$SendBucks, 1>
<$ViewHome, 0>

[Failed]
<h2>Failed</h2>
<p>
$Button=Continue,Tell,TryAgain

[END]


3) Max Payne had a FSM. You could name items and rooms in the level editor and then change their state like so (one line in the script):

::room1::enemy1->C_GoToAndShoot( ::room2::waypoint1, 1 );


Events and states were defined in the exact same way as in Netstorm: using blocks such as "[OnActivate]" or something similar. You could work out entire team strategies with this technique.

If you want to go further (and make it progressively more complex to integrate scripting, which I do _not_ recommend if not planned ahead/lack of time or present motivation) Unreal and Quake use their own dialect of Java (UnrealScript) and C (QuakeC) respectively, and today there are tons of other languages and their dialects: Lua, Python, AngelScript, etc.

This was just to show you it doesn't have to be hard or overly complex to add a simple scripting mechanic to your game, one that will do just that and nothing more.

PS. Half-Life 2 allows one to script (amongst others) enemy behavior using only a signal-slot mechanism. I've seen a complete pinball game consisting _only_ of a Half-Life 2 level (pure HL2, no modding/coding at all).
January 24, 2007 06:32 PM
Aardvajk
Wow. Thanks to everyone for all the suggestions. I've been innundated [smile].

I'll have to get back to you all on this as life is sort of taking precidence over game development at the moment.

Cheers.
January 25, 2007 02:44 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement