Tags

New releases and general discussions.

Post » Mon Jan 19, 2009 2:04 pm

TL;DR: Scroll to bottom. ;)

Okay, so I've been plotting the mindmap out and brainstorming about the cogs and springs of my RPG project. I realized that I will have to use some sort of '"tags", variables, which define behavior in context or an attribute. These tags would have to be dynamic, any character/npc/monster/enemy object would have a variable amount of different tags, such as allegiance (PlayerFaction, neutral factions, enemy factions), race (and its related tags such as BIPEDAL/QUADRIPEDAL)... basically, all of the tags would be BOOLEAN and the RPG engine would process them as needed within context.

As there is going to be a lot of variables (several races, four genders (HERMAPHRODYTE and UNISEX in addition to MALE and FEMALE), age (INFANT, CHILD, ADOLESCENT, ADULT and AGED), race (HUMAN, DWARF, ELF, ORC etc.) and so on), I figure I would have to break everything down into categories and tags, then as an entity is created, it is assigned tags.

Categories would be super-classes such as BODY, PERSONALITY, ABILITIES and TALENTS, further expanded into sub-categories (HEAD would have eye, ears, nose, mouth, jaw and such tags... a pig would have SNOUT instead of NOSE). ABILITIES would cover abilities one has, such as a dragon would have an FIRE_BREATH... an INFANT dragon would have NO_FLY tag, as it can't fly yet, but ADOLESCENT dragon would have FLY ability, so don't go poking it, lest it takes off and breathes fire from above. FLY can be either magical or physical, thus requiring WINGS of some sort, which can be damaged or crippled to limit the ability to fly.

Complex, eh? However if I manage to implement such a tag system, I could create a detailed RPG environment (combat, diverse entities and abilities) and most importantly expandable engine without having to dig through heaps of code. Just make ON Crippled WINGS > NO_FLY when it checks for damages and you've grounded the dragon! When its wings are healed, however, the FLY tag is restored.

Expandability also offers high replayability value; create a procedurally generated environment and characters (much akin to Nethack) and embark onto the epic journey that may end just round the corner or in deepest pits of the hell!

And best of all, tags offer customizability. Remove ones you don't want and your game will play without them, so basically you could have a realistic historical setting with only humans and physical weapons, no magic or fantasy creatures. Awesome, isn't it?



Now, if you have managed to read this far (an epic feat, I must admit), the question is... how should I go about implementing the tags system? Through attributes? Can they be created and set in run-time? Can they be checked for in conditions? Sould I use the alias function for tags?

This is why I am posting here. I am looking for ideas on implementation of the system described above. They all are boolean, they must be usable in expressions and conditions, they must be clear (hence capitalization) and they must be categorizable. They also can be static (given at creation of object, can't be changed) and dynamic (can change during course of adventure or a single encounter).

Oh joy, this makes me so excited!
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Mon Jan 19, 2009 11:31 pm

careful now!
small steps => small victories & small failures => continuous motivation!

that said: my first idea would be to implement tags using a private variable and the Find() system expression to check wether a tag is present. when i tried that, it turned out okay, but it appears there are some bugs (the condition that checks for a tag evaluates inverse truth).
[size=85:3pl72xtt]
(edit: it only evaluates inverse when picking families, so the bug is pretty specific there...)[/size:3pl72xtt]
B
2
S
2
G
4
Posts: 171
Reputation: 1,792

Post » Mon Jan 19, 2009 11:46 pm

Thanks, that was quite an amusing demo :lol: And yes, it made things clear.

I understand what you mean by small steps, however I want to make such steps that I can expand on. Private Variables are potentially something that is going to stab me back in the future.

I've been experimenting with Hashtables, but I've stumbled into a few problems... Eh, sometimes we gotta take a step back in order to move forward. ;)
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Mon Jan 19, 2009 11:56 pm

admittedly, when thinking about it, i don't know of any easy ways to e.g. remove specific tags out of a private variable... since i'm a newbie, you should probably look into more advanced techniques than my 'first ideas' ;)
B
2
S
2
G
4
Posts: 171
Reputation: 1,792

Post » Tue Jan 20, 2009 9:03 am

I made you an example:

viewtopic.php?f=16&t=2478

Ultimately hash table is best for this kind of thing, and by using containers you can give each object its own hash table to play with! Hash table is like a more powerful advanced variable system that lets you dynamically specify variable names :)
B
4
S
2
G
5
Posts: 641
Reputation: 3,011

Post » Tue Jan 20, 2009 11:47 am

Thank you very much for the example :) I'm going to use this solution. I intend to implement a fully expandable tag ystem and hashtables are ideal for that.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Tue Jan 20, 2009 9:30 pm

Okay, it really evaluates inverse when picking families. :shock:

For example I have the following condition:
[code:25y77vpo]Green: Pick by HashTable("Clicks")=1
> Green Set filter to 0
[/code:25y77vpo]
Green being the family. It does the opposite; the action is performed for ALL objects of the family except for those that pass the condition (i.e. have "Clicks" value of 1). Inverting the whole thing solves this neatly, but it is rather mean to be so misleading! :evil:

So many hours wasted just because of this...

Edit: nevermind all that, according to tracker the bug has just been fixed! Cheers! Bring on the next version, so that I can get some proper work done ;)
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Wed Jan 21, 2009 3:55 am

Instead of picking by evaluate, use pick by comparison. The pick by comparison works, and instead of typing = 1 you can just select equals and type 1 into the other parameter box :) And yeah i've fixed evalluate in the next build...sorry about that :(
B
4
S
2
G
5
Posts: 641
Reputation: 3,011


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 3 guests