Game Development Community

compatible with RTS Starter Kit ? TGE to T3D upgrade?

by Jeff Yaskus · in Arcane FX (Public) · 02/25/2010 (8:43 pm) · 9 replies

I'm curious is its possible to get the TGE version working with the RTS Starter kit. Does it plug in directly, require cut-n-paste changes or will require me to merge by hand ?

That said -- If I buy the TGE version and later want to upgrade and also get the T3D version ... is there an "upgrade" option or do I pay the full price all over again ?

#1
02/26/2010 (6:02 am)
Details regarding costs for upgrading from AFX2-for-TGE to AFX2-for-T3D are covered in this post:
www.torquepowered.com/community/forums/viewthread/108521

I'm not certain what the current status of RTS Starter kit is. It is not directly supported by AFX, but a number of users have made AFX and the RTS Starter work together, but it's certainly a small project to do so.
#2
02/26/2010 (9:16 pm)
Hi Jeff, thanks for quick feedback!

I've heard so many good things about AFX and seen examples of it working with the RTS Kit ... just no posts on how or what it takes.

As you may have guessed, im working with the RTS Kit (TGE) right now, but I also own a T3D license ... so plan to move to that platform eventually.

It sounds like basically I pay $100 for TGE version now and make up the $100 difference later to buy the T3D version.

Just thought maybe it was like T3D -- buy it and get all the previous versions included. Either way, it all works out the same --

Btw, heard tons of amazing stuff about AFX - so no doubt I'll be purchasing soon.



#3
02/27/2010 (12:09 pm)
Quote:
Just thought maybe it was like T3D -- buy it and get all the previous versions included.\
It is like T3D. A license for AFX2-for-T3D includes AFX2-for-TGEA and AFX2-for-TGE. But buying AFX2-for-TGE now and upgrading to AFX2-for-T3D later still amounts to the same total (assuming no price changes).

Probably the most important challenge regarding the merge of the RTS Starter Kit with AFX is the selection system. The RTS Kit implements multi-unit selections but it's selection highlighting is basic and hard-wired. AFX adds considerable flexibility in selection highlighting with Selectrons and Zodiac effects, but the selection system is more in the RPG style with only one object selection at a time. AFX2 adds free-targeting which probably helps, but the main project will be extending the AFX selection system to allow multiple unit selections.
#4
04/07/2010 (11:53 pm)
I've made some progress with merging the code ... the engine code compiles w/o any issues and I've manually merged example/arcane.fx/ with example/starter.RTS

And my game even loads up, Yippee!

So far, only noticed
(a) mouse at edge of screen no longer moves the viewpoint
(b) no selection rings
(but drag select does work -- as well as right click to move)


Q: How would I "call" the afx code to create a fireball ... so enemy goblin can fire on my players units ? Where might I find an example ??

If I could figure that out ... I could then use the knowledge to create special abilities / effects - for each unit.
Such as ; Healing, Poison Gas, Lightning or some burst effects centered on caster.
#5
04/08/2010 (5:29 am)
The stock afxDemo will cast Great Ball of Fire (if it's loaded) in response to pressing the 'f' key and should serve as a good example of scripted spellcasting.

First look at castGreatBall(), the function for handling f-key presses in default.bind_AFX.cs. It looks for the currently selected object and does a commandToServer() call to DoGreatBallCast().

serverCmdDoGreatBallCast() is in afxCommands.cs and finishes up by calling afxPerformSpellCast() on the server to cast the spell.
#6
04/08/2010 (1:23 pm)
I had some trouble with the client/server object but think I got it almost working now.

function serverCmdDoFireballCast(%client, %attacker, %target_ghost)
{   
  %obj_client = %attacker.getControllingClient();

   // server side - lets find the ghost IDs ?
  if (%target_ghost != -1)
    %target = %client.ResolveGhost(%target_ghost);
  else
    %target = -1;
    
  echo("\c2 serverCmdDoFireballCast :: " @ %attacker @" is casting GreatBallSpell at " @ %target @ " for client " @ %obj_client);
  trace(1);
  afxPerformSpellCast(%attacker, GreatBallSpell, %target, %obj_client);

It seems to get the variables correctly,but then I noticed ... its getting rejected for "invalid spell definition".


/c2 serverCmdDoFireballCast :: 9587 is casting GreatBallSpell at 9515 for client 0
   Console trace is on.
   Entering afxPerformSpellCast(9587, GreatBallSpell, 9515, 0)
      Entering DisplayScreenMessage(0, Invalid spell definition.)
      Leaving DisplayScreenMessage() - return 
   Leaving afxPerformSpellCast() - return 
   Entering afxPerformSpellCast(9587, GreatBallSpell, 9515, 8957)
      Entering DisplayScreenMessage(8957, Invalid spell definition.)
      Leaving DisplayScreenMessage() - return 
   Leaving afxPerformSpellCast() - return 
Console trace is off.
#7
04/08/2010 (2:41 pm)
I tried commenting out the "check" ... then it errors on readyToCast()

which I tried commenting out as well ...

// spell datablock gets last chance to find reasons to fizzle
//  if (!%spell_data.readyToCast(%caster, %target))
//    return;

  if (isObject(%client)) // for cooldown display 
    %caster.activeSpellbook = %client.spellbook;
   
  %spell = castSpell(%spell_data, %caster, %target, %rpg_data);

error messages;
/c2 serverCmdDoFireballCast :: 9582 is casting GreatBallSpell at 9528 for client 0
   Console trace is on.
   Entering afxPerformSpellCast(9582, GreatBallSpell, 9528, 0)
      castSpell() -- failed to find spell datablock [].
   Leaving afxPerformSpellCast() - return

Here is what the values are when I put in a checkpoint --
%spell =""
%spell_data = ""
%caster = 9582
%target = 9528
%rpg_data = GreatBallSpell
#8
04/08/2010 (3:02 pm)
had a hunch -- OK this sorta works now!!
%attacker.setEnergyLevel(50);
      echo("attacker energy level is " @ %attacker.GetEnergyLevel() );
      afxPerformSpellCast(%attacker, GreatBallSpell_RPG, %target, %obj_client);


I'll play around with it more - but looks awesome already.

Coolest thing already found that it is also doing AOE damage like it should.

Can't wait to mess with it more!

#9
04/09/2010 (7:34 am)
Woops! I didn't realize serverCmdDoGreatBallCast() was broken in the TGE and TGEA versions (works in T3D) so it was not the best example to point you to. Sorry about that. It's supposed to call afxPerformSpellCast() with GreatBallSpell_RPG rather than GreatBallSpell. That was a convention that changed with AFX2 so that multiple spells with differing afxRPGMagicSpellData definitions could share a single afxMagicSpellData.

Fortunately, it looks like you worked that out.

If you don't require the various checks done in afxPerformSpellCast() you can consider these more direct ways of launching spells:

%spell = castSpell(%spell_datablock, %caster, %target);

OR

%spell = new afxMagicSpell() {
datablock = %spell_datablock;
caster = %caster;
target = %target;
};

Note -- in these cases %spell_datablock would be GreatBallSpell and not GreatBallSpell_RPG.