.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $6.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old April 11th, 2008, 08:00 PM
Ed Kolis's Avatar

Ed Kolis Ed Kolis is offline
General
 
Join Date: Apr 2001
Location: Cincinnati, Ohio, USA
Posts: 4,547
Thanks: 1
Thanked 7 Times in 5 Posts
Ed Kolis is on a distinguished road
Default Re: EGGS - yet another programming project

The thing is, while I want an entity to inherit all the inherent abilities from its archetype, other types of inheritance are different; they're based on arbitrary rules. For instance, a "storage capacity" ability might need be inherited from components (adding cargo bays to a design adds capacity) but not from contents (putting a ship into cargo of a starbase does not increase the starbase's cargo capacity). Or a "warp damper" ability might have a range of N parsecs and only affect enemy ships, where N and the definition of "enemy" are determined by custom logic (say, the damper ability value has a Range property which determines N and a FindEnemies function which queries the owner, location, and "game object type" ability of entities - hmm, I need to add an Owner property to the entities once I implement the Player class! )

Hmm, though I suppose I need some way of "cloning" an entity, and maybe a even a distinction between "real" entites and abstract archetypes, seeing as I don't have a way for an entity to inherit components from its archetype, which is clearly needed for a "unit design" system! *sigh* Instead of having a separate class for archetypes, though, I think maybe I'll just have an IsAbstract flag on the entity class, and that can be set and checked as necessary, so that for instance you don't have the archetypal "Phased Polaron Beam" being treated as an actual Phased Polaron Beam which just happens to not be installed anywhere... or maybe it's only semantics whether the PPB archetype is an actual PPB or not, as long as it inherits and passes on the correct abilities But I'm pretty sure I need a way to automagically "clone" an entity, otherwise it will be tedious to, for instance, build a ship, as the user of my library would have to do stuff that I should be doing - "ok, we have this Design entity, now we need to copy that and all its components and abilities and stuff to a Ship entity... oops, we have to go and do that recursively for every component on the design..." - I should handle that myself

edit: ooh, problem - with the warp damper, what if you put that ability on a *ship*? Then while it will be inherited by nearby enemies, it will also be kept by the entity itself! I guess abilities need some way of knowing where they "came from" and a way of displaying differently based on which entity they originated with! (This would also solve another problem, namely that of unwanted recursive inheritance - while you want a mass ability to be inherited recursively, you do NOT want a warp damper ability to be inherited recursively, as it would act as a "chain lightning" effect or something akin to the Molecular Disruptor from "Ender's Game", continually extending its reach until there are no more entities within range of any entity in the "inheritance net", not to mention jumping BACK to the entity which it originated with, causing an infinite loop! While this is cool for weapons - weapons do damage so barring an emissive armor type of effect, the damage will eventually destroy enough entities that there are none left in range - it is not something you want to happen without any sort of dissipative effect such as damage to entities!) In any event, then you could have an component entity with a "does X effect to entities within Y range", and a rule that lets the entity's ability inherit to the entity it's a component of before becoming a "foreign" ability - but then after that, it becomes a "this entity is affected by X effect!zomgzomgoneoneone" ability.

*sigh* more coding for me But at least this irons out some issues ahead of time
__________________
The Ed draws near! What dost thou deaux?
Reply With Quote
 

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 12:09 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2024, Shrapnel Games, Inc. - All Rights Reserved.