BROO's Forum Posts

  • How to organize unit variables?

    Never made any RTS, but I think it'd be a good idea to make use of HashTable object / Ini object to store some game configuration data like:

    • game speed
    • gamma correction

    (name: "AppConfiguration")

    Another HashTable object / Ini object to store units constant configuration:

    • unit starting HP (when new object created, set its HP to this value)
    • unit cost
    • unit speed (when new object created, adjust its maximal speed and stuff to this value)
    • unit armor class
    • unit damage

    (name: "GameConstant")

    Another one for storing varying game data like upgrades.

    (name: "GameState")

    And provide every unit with set of Private Variables that are unique for every instance:

    • unit HP
    • unit Order Type (move/attack/gather/stop/hold)
    • unit Referenced Object (like pointer to enemy object for attacking or resources object for gathering etc.)
    • unit Destination Position (if not ordering to go into another unit but on "clean" location)

    Saving/loading game is quite easy because all object's transferring private variables should be done automatically (haven't tested yet).

    If you're familiar with programming, then it's quite simple to imagine that you can handle game logic with "foreach object" easily and access objects through their Unique ID like substitute for references.

  • Seed would provide you with repeatable random sequences which would be of use when creating replays of game (so that you won't have to store all random moving objects position but only seed that'd reprocude all their movement correctly).

  • OK, understood.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Probably because XAudio2 is involved and Direct Sound is going to be obsolete.

  • Internal.hpp(26):

    return IDE_FLAGS;

    Internal.hpp(255):

    objectInfo->ideFlags = IDE_FLAGS;

    Problem is about IDE_FLAGS from main.h:

    If you don't want any set, then you can do it like this:

    #define IDE_FLAGS 0[/code:1m25yr8l]
    
    You can't do it like this:
    [code:1m25yr8l]#define IDE_FLAGS[/code:1m25yr8l]
    Nor deleting this line is allowed.
  • Check your project properties to see where are those files deployed.

    Look at this picture:

    http://apps.sourceforge.net/mediawiki/c ... Cofig8.png

    (this is AFAIR from "Linker" at project properties)

    ..\..\Construct\Plugins\GradientCalc.csx.

    It means theat if you have your Construct installed at:

    C:\Program Files\Scirra\Construct

    Then location of project file must be one level below (for example C:\Program Files\Scirra\Construct\MyObjectCode).

    Note that in SDK we've paths like:

    ..\..\IDE\Plugins\Runtime\Template.csx - for runtime

    ..\..\IDE\Plugins\Template.csx - for edittime (release)

    Change those directiores to make destinations match.

  • All of those you mentioned cannot be classified as "C++ development studio".

  • I have Visual Studio 2005 Pro from university. Don't own any though.

  • It's technically possible. Canvas object allows to do basic painting operations, and Image Manipulator object can save/load images to files.

  • Solved.

    In casy somebody asked:

    You put "pRuntime->AddDebuggerItem" into ExtObject::DebuggerUpdateDisplay method

    And write:

    if (label== "Hi-Jump Available")

    hiJump=iValue;

    In ExtObject::OnDebuggerValueChanged method

  • How to add Runtime Object's fields into Debugger?

    There's a "pRuntime->AddDebuggerItem" method, but I'm not sure where to place it and what other actions to take to make some fields visible in Debugger's "Properties" (for example "Text Object" shows one property).

  • Thanks for quick bugfix ^^.

  • Thanks. That explains everything ^^.

  • There are several problems I'd like to clarify ^^. Working in C++ is really painful for me so tests would take hours ><'. You Devs probably know answer ^^.

    1. Serialization order

    Let's say I've fields: myVal1, myVal2 in EditObj, and fields: myFirst, mySecond in RuntimeObj. How should I do serialization stuff in code (serialization.cpp). Is this solution correct (treating 'ar' as stack):

    /////////////////////////////
    // RUNTIME serialization
    void ExtObject::Serialize(bin& ar)
    {
    	if (ar.loading) 
    	{
    		ar >> mySecond;
    		ar >> myFirst;
    	}
    	else 
    	{
    		ar << myFirst;
    		ar << mySecond;
    	}
    }[/code:cwqirkhd]
    [code:cwqirkhd]/////////////////////////////
    // EDITTIME serialization
    void EditExt::Serialize(bin& ar)
    {
    	int Version = 1;
    	SerializeVersion(ar, Version);
    
    	if (ar.loading) 
    	{
    		ar >> myVal2;
    		ar >> myVal1;
    	}
    	else 
    	{
    		ar << myVal1;
    		ar << myVal2;
    	}
    }[/code:cwqirkhd]
    
    2. Passing values from EditObj to RuntimeObj
    Created RuntimeObj stores handle to EditObj to have access to its data and stuff. Let's say I've two values in EditObj: myVal1 and myVal2. I want to make use of them during Runtime as well (by ACE Methods). Do I need to make fields "myVal1, myVal2" in RuntimeObj as well and duplicate data from EditObj in method "void ExtObject::OnCreate()", or maybe I can access EditObj fields from ACE Methods and not worry about making fields at RunTime Object?
    
    3. Serialization in runtime
    This question is somehow related to #2. Surely serializing object in Runtime is used for QuickSave/QuickLoad its state. When making QuickSave in runtime, does corresponding EditObj data serialize as well?
  • 50 weapon with unique bullets, properties, logic and drawing routines? Even in programming language that'd be hard to maintain. Construct allows to organize objects in "families", you can think about it like a container of all instances of classes included within it (kinda "base class").

    Construct eventsheets are based on events rather than scripts, I like actual functionality of it. Before getting into eventing you can prepare a pseudocode.

    As for using methods I recommend getting to know "Function Object". It fully includes the idea of making methods with returnable value. Construct documentation describes it.