Jump to content

  • Log In with Google      Sign In   
  • Create Account


skywhnnn

Member Since 12 Sep 2013
Offline Last Active Sep 15 2013 01:19 PM

Posts I've Made

In Topic: adding new feature requires 99 code changes!

15 September 2013 - 04:56 AM

Having logically duplicate code even once is a terrible habit.

 

You can continue removing cavemen as you used to, but spawn new "corpse" entitties and process them in your render pass.

If you want for some reason to keep corpses same entities as alive ones, you can make isActive function (active & not dead) instead of plain field, while in render pass you can opt dead in.

And there are even better ways if you implement suitable architecture.


In Topic: Need architecture advice

13 September 2013 - 02:09 PM

Ok, let me explain myself deeper.

 

I'm asking not as a developer looking for a practical guidance, but as a project manager looking for theoretical opportunities.

I understand very well that architecture alone won't get you anywhere, however I work with people instead of working with sourcecode (well, I do work with sourcecode, but it's secondary) — and it's a huge difference. I can find an expert in, say, pathfinding or rendering via certain engine pretty easily, however noone can grant me that he won't get depression in the middle of a project, or get an offer he can't resist, or whatever — I had experience of the course changing because of really absurdous reasons. And I can tell you, specialist market is very limited if you have a tight budget, so having an opportunity of flexible architecture as hedge is very important, cause it's often far more effective to rebuild project with new architecture which fits your developer than try to make him switch to an old one.

 

In quick web projects, or complex enterprise projects this is less of a problem (everything goes for former and strict standards for latter), but I find gamedev to have much more room for freedom.

 

My context examples were really just examples — I'm simply looking for an example solution to have one codebase for multiple final patterns.

 

I had experience of implementing smth similar for 2 contexts, but it was quite terrible and specialized for a certain project therefore nonextensible, while making an extensible one would require too much time, that's why I'm looking for something already existing.


In Topic: Need architecture advice

13 September 2013 - 02:04 AM

Thank you for the reply,

 

I understand the question may seem too vague, so I'll try to give a simple narrow example (please don't be picky on whether it's actually a good approach, it's just theoretical case).

 

Let's say, we have a game with weapon "sword" which has "damage" property, and 3 contexts:

 

data context it's present as simple ORM: "items" table (sword), "item_property table" (damage), "item_property_value" (sword damage=1), "player_items" table (Bob has a sword).

In plain OOP context it's present as class Sword extends MeleeWeapon extends Weapon... with "damage" field.

in component context it's present as Entity with MeleeWeapon component which has "damage" field.

 

What am I looking for, is a solution to define that "sword has damage" only once, and services to generate corresponding classes for each context, instead of having to define all 3 separately.

Build tasks: I modify sword damage in the server db and want to produce files required for client update automatically.

Config tasks: I want to keep my data context as is, but  I want the Entity to additionaly have SlashingWeapon and PiercingWeapon components with default values.


PARTNERS