User Tag List

Results 1 to 5 of 5

Thread: Handling Alterable Values with multiple Groups

  1. #1
    Clicker Fusion 2.5+ DLCMultimedia Fusion 2HTML5 Export Module
    Kentronisk's Avatar
    Join Date
    Nov 2011
    Posts
    211
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Handling Alterable Values with multiple Groups

    Hey
    There is one challenge that keeps on haunting me, and Im curious as to if there is a more efficient way than what I do. Basically, most of my objects in my game are in multiple groups. Ill take an example of a Super Mario game. This is basically how I would build a simple enemy:

    I make a group for Horizontal movement, that will require 2 Alterable Values: MovementSpeed (a constant number) and Direction (1 or -1).

    I make a group for enemies that are killable by being jumped on. Lets just say this will require 1 Alterable Value for what the enemy will drop when it dies (coins, feather, mushroom, nothing).

    I make a group for enemies that are killable by fireball, and give this 1 Alterable Value also for what the enemy will drop.

    I make a group for enemies that will hurt Mario, and use 1 Alterable Value for the damage it does to Mario (so if Mario have a fire flower, 1 dmg will downgrade to just big, 2 dmg will downgrade to small and 3 dmg will instant kill).

    So now, Alterable Value A, B, C, D and E are now occupied. If I make a new enemy that are not killable by being jumped on or shot by fire (say, a spike or just lava), the object will have to "waste" the first 4 Alterable Values, because they are irrelevant. This is a little bad in my opinion, but its not the biggest challenge. Lets say there are a bunch of more Alterable Values occupied (one for enemies that can be eaten by Yoshi and what he will spit out again, ++ lots others), I then decide that I want to add an Alterable Value to the group that are handling fireball. I want some enemies to take 2 or 3 hits. This is simple enough by just adding an Alterable Value FireballHealth or something to the enemies, but in my structure, this is getting a little tricky. I must then find the group that uses the last/lowest (closest to end) Alterable Value and use the next Alterable Value after this as the one handling the Health. At some point, this will just be a total mess.

    So I am kinda curious as to if someone is having a clever technique to actually handle things like this? By the years, I am able to foresee a lot of this in my planning phase, but this happens everywhere. And I am mixing groups in every direction. Maybe I have enemies that the player can stand on, which will bring obstacles into the picture aswell, and obstacles uses Alterable Values that crashes with the enemy ones. Lots of possibilities..

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    This is a wide question, involving the way one approaches a number of problems,
    like objects categories (the fewer, the better? or not?) and sub-categories.

    This is one of those situations where I think we would benefit from a builtin Structured Query Language
    to work more efficiently with multiple tables of data.

    I think the way to go would be not storing these values in objects,
    but rather in a database linked to those objects IDs
    and prepare basic tables with all objects attributes

    like:

    TYPES tables

    "type_enemy"
    enemy type: mushroom
    sub_type: horizontal_slow, jumpable, fireball-able
    drops: basic
    damage: 2

    "horizontal_slow"
    move_speed: 1
    [...]

    "horizontal_fast"
    move_speed: 10
    [...]

    "basic"
    10%: feather
    30%: coin
    60%: nothing


    (now, some of this is hardly needed in such a simplified situation,
    and for direction I would anyway leave like in object's flags,
    but just for the sake of the example...)

    jumpable and fireball-able I would leave out,
    as don't involve other checkings,
    other than "react-to-code"
    so that in your code you would just need:

    fireball hitting "enemy"
    +sub_type("enemy") contains "fireball-able"
    >>> do damage


    Then for single enemies realtime values,
    each would have its own entry in the database,
    like:

    "enemies_table"
    enemy ID xxxxxxx
    hp:
    alive:
    position:
    etc.

    so that each one would have its unlimited list of attributes unified and referenceable in the very same place.


    One could do something like this with arrays, but in a much more limited way (hardly with filters and joins)

  3. #3
    Clicker Fusion 2.5+ DLCMultimedia Fusion 2HTML5 Export Module
    Kentronisk's Avatar
    Join Date
    Nov 2011
    Posts
    211
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, thanks for reply
    Arrays is what I was first thinking of using.. Although an actual database sounds more straightforwardly. I am a little sceptical as to doing all these queries though. There will probably be like 100 queries every frame. I also looked into what databases that are available, and I see Sqlite is one of them. Seems like you can create a database in the memory, which is good. But it seems to have limitations to 1 table (?). What object did you have in mind for this??

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    Yeah, this was not a proper suggestion
    It was more of a feature request for Clickteam
    because I was thinking that providing a SQL builtin structure
    (or better, any relational database to interact with SQL)
    would be much more flexible and provide tons of benefits for tons of projects,
    as of now, I can't think of any much better way than the one you're already doing,
    without a proper manageable database, you would probably be complicating things.

    SQLite extension is good,
    and with an SQLite database you can have unlimited tables/queries etc.
    downside (beside non-portability) is it's slow,
    compared to an array it's hugely slow.
    Querying data in real time could be an issue
    (although not in above platformer example, where data access is not-that-intensive)

    But i.e. for an RPG, having a SQL database would be pure gold,
    querying objects to pop out,
    joining tables of characters types/attributes,
    inserting/deleting records of players
    etc.etc.
    All would be very easy to manage (also taking advantage of lots of already existing tools)
    improve, modify...

    Current setup with arrays and alt.values feels like "mimicking" a proper database structure to me.
    That's why you can hardly think of something better, we have some limitations here, as of now.

    Maybe Fusion3 will boost database interaction, who knows?

  5. #5
    Clicker Fusion 2.5+ DLCMultimedia Fusion 2HTML5 Export Module
    Kentronisk's Avatar
    Join Date
    Nov 2011
    Posts
    211
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I will look into arrays, which was what I had planned in the first place :P Maybe in Fusion3 there will be a way to link alterable values by names/ids rather than location or index.
    Thanks for replies anyway

Similar Threads

  1. Handling Multiple Channel Connections
    By netninja in forum Lacewing
    Replies: 3
    Last Post: 2nd November 2018, 06:42 PM
  2. Replies: 4
    Last Post: 1st July 2014, 07:27 PM
  3. Adding alterable values of multiple objects
    By Digitalic in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 11th June 2010, 01:40 PM
  4. Handling the Hp of multiple opponents
    By Yima in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 9th November 2009, 08:36 PM
  5. Alterable Strings and Alterable Values limit :(
    By Pedro Almeida in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 13th October 2006, 06:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •