Be a Supporter!

The Flash 'Reg' Lounge

  • 1,942,171 Views
  • 64,541 Replies
New Topic Respond to this Topic
MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge 2013-10-07 13:45:49 Reply

At 10/7/13 12:43 PM, Rustygames wrote: Copy and paste what exactly?

The entirety of the source code. I'm in the process of rewriting the entire engine to be more robust and less shitty. The next one in the series will (hopefully) be a re-skinned version of this game with the necessary changes.

The first one was very short, it was like a demo/teaser to me (unless I missed a big chunk of it which is possible!)

I think you missed some stuff. I don't remember exactly, but I added beta testers well before it was done.

Since we're doing game updates:

I got saving and loading more or less finished on mine. I was pleasantly surprised to see I'd already done the DB schema and back end processing code when I went to finish the front end after a month long hiatus.

What game is this exactly? Was it that card game, or was that someone else's?

Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Supporter
Level 19
Programmer
Response to The Flash 'Reg' Lounge 2013-10-07 14:06:38 Reply

At 10/7/13 01:45 PM, MSGhero wrote:
At 10/7/13 12:43 PM, Rustygames wrote: Copy and paste what exactly?
The entirety of the source code. I'm in the process of rewriting the entire engine to be more robust and less shitty. The next one in the series will (hopefully) be a re-skinned version of this game with the necessary changes.

The first one was very short, it was like a demo/teaser to me (unless I missed a big chunk of it which is possible!)
I think you missed some stuff. I don't remember exactly, but I added beta testers well before it was done.

Ahhh okay. Yeah it was the beta I played. I will have to give that a play now it's out!

Since we're doing game updates:

I got saving and loading more or less finished on mine. I was pleasantly surprised to see I'd already done the DB schema and back end processing code when I went to finish the front end after a month long hiatus.
What game is this exactly? Was it that card game, or was that someone else's?

Yeah it's the card game :)
By saving and loading I should have said it's a deck builder which allows you to make a deck, save it into a slot (6 slots for different decks), and then load it for later.

It checks on the server to make sure you've built a valid deck out of cards that you actually own (to stop those naughty little front end hackers) and saves it to the db linked to your user account. User login (and everything else!) is all server side so there is no opportunity for any funny business.


- Matt, Rustyarcade.com

Rudy
Rudy
  • Member since: Jan. 1, 2005
  • Offline.
Forum Stats
Member
Level 18
Blank Slate
Response to The Flash 'Reg' Lounge 2013-10-07 20:27:29 Reply

Word.


BBS Signature
egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Supporter
Level 05
Game Developer
Response to The Flash 'Reg' Lounge 2013-10-07 21:04:10 Reply

At 10/7/13 08:27 PM, Rudy wrote: Word.

Yes. Yes it is.
Good job! :3


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to The Flash 'Reg' Lounge 2013-10-08 14:26:15 Reply

My game engine is getting closer and closer to a 2d Unity engine. I'm just going to add trigger/switch scripting, and then try making a game out of it...but I'm feeling that it's very close to production status, at least for a few games, so I'm excited. Plus it's very easy for me and my artist to test things out/exchange levels, since the whole state of the game engine can be saved into a file. Super handy.

Entity Systems ++

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge 2013-10-08 14:31:46 Reply

At 10/8/13 02:26 PM, PSvils wrote: Entity Systems ++;

Fixed. And as useful as minimalcomps are, I really hate organizing all the buttons and boxes. I found minimalconfigurator which lets you define the layout in xml which is handy, but it can only do so much. Comboboxes are a nightmare.

Innermike
Innermike
  • Member since: Sep. 11, 2009
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to The Flash 'Reg' Lounge 2013-10-08 17:20:34 Reply

At 10/8/13 02:31 PM, MSGhero wrote:
At 10/8/13 02:26 PM, PSvils wrote: Entity Systems ++;
Fixed. And as useful as minimalcomps are, I really hate organizing all the buttons and boxes. I found minimalconfigurator which lets you define the layout in xml which is handy, but it can only do so much. Comboboxes are a nightmare.

I swear I get freaked out when I see people with these big ol game engines/editors that let them make everything but the kitchen sink. I'm far too lazy. I just try to plan what I know I'll need and leave things fairly clean enough to put it extra stuff on the way if I realize I absolutely need it (cut-scene editor in dreamlike pixels was probably my biggest oversight).

I've never seen starting from almost scratch with each game a hinderance or "inefficient", I feel like it's an intimate/essential part of my experience, only when it comes to personal projects though of course. But I'm still young so \_(ツ)_/


nobody

PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to The Flash 'Reg' Lounge 2013-10-09 04:24:39 Reply

At 10/8/13 05:20 PM, Innermike wrote:
At 10/8/13 02:31 PM, MSGhero wrote:
At 10/8/13 02:26 PM, PSvils wrote: Entity Systems ++;
Fixed. And as useful as minimalcomps are, I really hate organizing all the buttons and boxes. I found minimalconfigurator which lets you define the layout in xml which is handy, but it can only do so much. Comboboxes are a nightmare.
I swear I get freaked out when I see people with these big ol game engines/editors that let them make everything but the kitchen sink. I'm far too lazy. I just try to plan what I know I'll need and leave things fairly clean enough to put it extra stuff on the way if I realize I absolutely need it (cut-scene editor in dreamlike pixels was probably my biggest oversight).

I've never seen starting from almost scratch with each game a hinderance or "inefficient", I feel like it's an intimate/essential part of my experience, only when it comes to personal projects though of course. But I'm still young so \_(ツ)_/

I'm extremely lazy, hence me focusing on my tools first, so that making a game becomes a very easy thing to do!

Also, while programming my own games, I've realized that I just duplicate too many things instead of being able to focus on new and interesting functionality. So I just made all the low-level subsystems like display etc., generic. So hopefully when I make a game, I'll only be making the game part.
I think it only makes sense to eventually have your own code base to constantly work from.

gamzary
gamzary
  • Member since: Oct. 9, 2013
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to The Flash 'Reg' Lounge 2013-10-09 05:25:40 Reply

nice


wellcome

Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Supporter
Level 19
Programmer
Response to The Flash 'Reg' Lounge 2013-10-09 14:12:38 Reply

At 10/9/13 04:24 AM, PSvils wrote:
At 10/8/13 05:20 PM, Innermike wrote:
At 10/8/13 02:31 PM, MSGhero wrote:
At 10/8/13 02:26 PM, PSvils wrote: Entity Systems ++;
Fixed. And as useful as minimalcomps are, I really hate organizing all the buttons and boxes. I found minimalconfigurator which lets you define the layout in xml which is handy, but it can only do so much. Comboboxes are a nightmare.
I swear I get freaked out when I see people with these big ol game engines/editors that let them make everything but the kitchen sink. I'm far too lazy. I just try to plan what I know I'll need and leave things fairly clean enough to put it extra stuff on the way if I realize I absolutely need it (cut-scene editor in dreamlike pixels was probably my biggest oversight).

I've never seen starting from almost scratch with each game a hinderance or "inefficient", I feel like it's an intimate/essential part of my experience, only when it comes to personal projects though of course. But I'm still young so \_(ツ)_/
I'm extremely lazy, hence me focusing on my tools first, so that making a game becomes a very easy thing to do!

Also, while programming my own games, I've realized that I just duplicate too many things instead of being able to focus on new and interesting functionality. So I just made all the low-level subsystems like display etc., generic. So hopefully when I make a game, I'll only be making the game part.
I think it only makes sense to eventually have your own code base to constantly work from.

Totally agree a code base which you use time and time again in your games is essential. Mostly the little component and utility things are what you'll end up reusing a lot (Some custom math functions, standard algorithms [a* for example], buttons and other custom ui elements). A solid barebones framework is handy but obviously you all know my views on this (PureMVC all the way baby). If everything is built modular enough then you will find ways of recycling bits and pieces here and there.

That being said, I can't say I'm totally sold on what I've heard a couple of you doing which is to build a massive library of, as our friend Mike put it, "everything but the kitchen sink". I mean, building lots of functionality, potentially hard tied to a 'framework', "just in case" you need it doesn't sound like the most efficient or productive way of going about things.

Obviously I may be misunderstanding what you guys are up to, but I remember Eggy Mario seemed to have quite the comprehensive library going on which made me come to that conclusion.


- Matt, Rustyarcade.com

PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to The Flash 'Reg' Lounge 2013-10-09 15:13:47 Reply

At 10/9/13 02:12 PM, Rustygames wrote: Totally agree a code base which you use time and time again in your games is essential. Mostly the little component and utility things are what you'll end up reusing a lot (Some custom math functions, standard algorithms [a* for example], buttons and other custom ui elements). A solid barebones framework is handy but obviously you all know my views on this (PureMVC all the way baby). If everything is built modular enough then you will find ways of recycling bits and pieces here and there.

That being said, I can't say I'm totally sold on what I've heard a couple of you doing which is to build a massive library of, as our friend Mike put it, "everything but the kitchen sink". I mean, building lots of functionality, potentially hard tied to a 'framework', "just in case" you need it doesn't sound like the most efficient or productive way of going about things.

Obviously I may be misunderstanding what you guys are up to, but I remember Eggy Mario seemed to have quite the comprehensive library going on which made me come to that conclusion.

The beauty of my current engine is its modularity, where adding new functionality is super easy, and doesn't interfere with existing code at all. And right now, my engine is based around creating a game; I'm not loading it with features pointlessly, right now it just has physics, display (just native vector DisplayObject stuff for now), an asset loading system, switches, weapons...well, amounting to a lot of stuff, but it's all the basics.

So my biggest point or emphasis about my engine isn't that I've hardcoded in a bunch of features for every game that I can currently imagine, its architecture itself is just open enough that I can quickly add things, or change things, while reusing any feature I need from other games. So if I program something once, I'll hopefully have to never program it again.

Plus it's very easy to add a level editor for it, which is basically just some UI elements sitting on top of the engine itself. I can change stuff, play the game a bit, pause it, and change some more stuff, and keep playing from that same point.

All of this isn't mainly "my engine", it's actually just the whole concept of Entity Systems that make everything so easy. If anyone hasn't read up about them, despite me spamming those 2 words, then do it finally.

P.

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge 2013-10-09 16:13:56 Reply

At 10/9/13 03:13 PM, PSvils wrote: All of this isn't mainly "my engine", it's actually just the whole concept of Entity Systems that make everything so easy. If anyone hasn't read up about them, despite me spamming those 2 words, then do it finally.

I imagine his system ending up as a drag n drop game maker once it's done.

PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to The Flash 'Reg' Lounge 2013-10-09 17:19:24 Reply

At 10/9/13 04:13 PM, MSGhero wrote:
At 10/9/13 03:13 PM, PSvils wrote: All of this isn't mainly "my engine", it's actually just the whole concept of Entity Systems that make everything so easy. If anyone hasn't read up about them, despite me spamming those 2 words, then do it finally.
I imagine his system ending up as a drag n drop game maker once it's done.

Well right now my entity/component editing is very similar to Unity's, without meaning to.

But very soon it will be drag'n'drop :)

Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Supporter
Level 19
Programmer
Response to The Flash 'Reg' Lounge 2013-10-09 17:41:58 Reply

At 10/9/13 05:19 PM, PSvils wrote:
At 10/9/13 04:13 PM, MSGhero wrote:
At 10/9/13 03:13 PM, PSvils wrote: All of this isn't mainly "my engine", it's actually just the whole concept of Entity Systems that make everything so easy. If anyone hasn't read up about them, despite me spamming those 2 words, then do it finally.
I imagine his system ending up as a drag n drop game maker once it's done.
Well right now my entity/component editing is very similar to Unity's, without meaning to.

But very soon it will be drag'n'drop :)

Ahh entity systems. An old colleague of mine was obsessed with them quite a few years ago. He even went and did a presentation on them at the LFPUG. He built a framework for it, then someone else did a better one so he contributed to that instead. Despite all of this it's taken me until now to look it up just because you lot have been chatting about it recently :)

So my question to you is: which part is new to you and turning you on to entities? The composition over inheritance part of it or the component based design part?

I only ask because these are the two things in programming which have a hundred different names for slight variations in principle or implementation and are constantly being reinvented or "re-branded". Ultimately they all boil down to the same thing!


- Matt, Rustyarcade.com

PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to The Flash 'Reg' Lounge 2013-10-09 17:52:50 Reply

At 10/9/13 05:41 PM, Rustygames wrote: Ahh entity systems. An old colleague of mine was obsessed with them quite a few years ago. He even went and did a presentation on them at the LFPUG. He built a framework for it, then someone else did a better one so he contributed to that instead. Despite all of this it's taken me until now to look it up just because you lot have been chatting about it recently :)

So my question to you is: which part is new to you and turning you on to entities? The composition over inheritance part of it or the component based design part?

I only ask because these are the two things in programming which have a hundred different names for slight variations in principle or implementation and are constantly being reinvented or "re-branded". Ultimately they all boil down to the same thing!

Definitely the component based design part, because it makes everything so generic. A player is an entity with a certain set of components, and an enemy entity would have the same components, except instead of a PlayerComponent, it would have a GoblinComponent. So adding new things doesn't break existing code, all functionality is divided between the components and the systems to run them.

My entity system is based on a strict division of logic and data. Components are pure data. They are objects with public properties, and no functions, unless they're just helpers for setting/getting the data.
Systems request all entities with a certain set of components. And so as soon as an entity contains all the necessary components for a system, the system will start processing it.

It makes all code reusable, because of how modular and detached it is from each other. The component based aspect of it is essentially the composition over inheritance part.

Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Supporter
Level 19
Programmer
Response to The Flash 'Reg' Lounge 2013-10-09 18:16:09 Reply

At 10/9/13 05:52 PM, PSvils wrote:
At 10/9/13 05:41 PM, Rustygames wrote: Ahh entity systems. An old colleague of mine was obsessed with them quite a few years ago. He even went and did a presentation on them at the LFPUG. He built a framework for it, then someone else did a better one so he contributed to that instead. Despite all of this it's taken me until now to look it up just because you lot have been chatting about it recently :)

So my question to you is: which part is new to you and turning you on to entities? The composition over inheritance part of it or the component based design part?

I only ask because these are the two things in programming which have a hundred different names for slight variations in principle or implementation and are constantly being reinvented or "re-branded". Ultimately they all boil down to the same thing!
Definitely the component based design part, because it makes everything so generic. A player is an entity with a certain set of components, and an enemy entity would have the same components, except instead of a PlayerComponent, it would have a GoblinComponent. So adding new things doesn't break existing code, all functionality is divided between the components and the systems to run them.

My entity system is based on a strict division of logic and data. Components are pure data. They are objects with public properties, and no functions, unless they're just helpers for setting/getting the data.
Systems request all entities with a certain set of components. And so as soon as an entity contains all the necessary components for a system, the system will start processing it.

It makes all code reusable, because of how modular and detached it is from each other. The component based aspect of it is essentially the composition over inheritance part.

It certainly does sound interesting to have the systems automatically pick up on which VO's (components) have that data and then act upon them if they do. Presumably any changes would either be polled or the system would just fire some update event notifying the view components to redraw etc.

I can see the systems becoming somewhat hard coupled though. Allow me to use wikipedias example to illustrate a scenario:

"Another system could be a collision detection. It would iterate through all entities that have a physical component, as it wouldn't care how the entity is drawn. This system would then detect arrows that collide with monsters, and generate an event when that happens. It shouldn't need to understand what an arrow is, and what it means when another object is hit by an arrow.
Yet another component could be health data, and a system that manages health. Health components would be attached to the human and monster entities, but not to arrow entities. The health management system would subscribe to the event generated from collisions and update health accordingly. This system could also now and then iterate through all entities with the health component, and regenerate health."

The problem I foresee here is that you instantly have a hard coupled dependency between the health system and the collision system. The health system must update it's components on certain collision events.

Suppose the angle you hit a wall at is relevant to how much health you lose. That data would need to come in a payload from the collision event.

Now what if I want to take my health system and move it to another game where collision is not the system which health events are interested in, and damage is no longer calculated based on angle, it's based on how sharp the enemies sword is. I'm going to either add methods to health and leave some unused redundant code in there (very bad) or write a new health component (meaning the code isn't reusable).

Also I was wondering about systems editing many components and potentially conflicting since it's a bit of a free-for-all on them.

Please forgive me if I'm talking rubbish since I've never used the pattern before :)


- Matt, Rustyarcade.com

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge 2013-10-09 23:30:09 Reply

I cheated OOP for the first time this game. I'm not proud, but I'm certainly not writing cutscene commands for 50 individual people. I put them into 2 groups and manipulate those, but the group class had to extend the child class to keep everything else consistent, and I had to override half the methods so they wouldn't break...so yeah. Messy and a slight bit of hard-coding, but fuck it.

gods of OOP, i beg for forgiveness
egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Supporter
Level 05
Game Developer
Response to The Flash 'Reg' Lounge 2013-10-10 16:27:04 Reply

For the last week or so I've been staying up until 2 in the morning to edit YouTube videos and waking up at 7 in the morning for math class. A video a day is not easy .-.
Though i've been doing two since Terraria is no longer getting views. Everybody's got the game, now :(

It's fine, i'll find other games that aren't quite out yet or just out to play. And horror games because October. Fuck horror games and everything they stand for >:(


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Supporter
Level 19
Programmer
Response to The Flash 'Reg' Lounge 2013-10-10 16:46:49 Reply

Eggy Mario, link plz


- Matt, Rustyarcade.com

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge 2013-10-10 17:57:20 Reply

At 10/10/13 04:27 PM, egg82 wrote: Though i've been doing two since Terraria is no longer getting views. Everybody's got the game, now :(

If we were near the same level in dota2, I'd suggest recording a game with me on skype. I get pretty heated when my team is bad, and they often are.

This tutorial game thing is becoming a normal game, but I'm documenting the hell out of the dev process. It'll be a temperature-based platformer or something; an alien dude who needs to maintain his body temperature while ____ on earth. PSvils will come up with ideas for that blank after getting tobacco.

"doood. those things would facillitate my compound of the elixir of creativity"
egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Supporter
Level 05
Game Developer
Response to The Flash 'Reg' Lounge 2013-10-10 19:18:43 Reply

At 10/10/13 04:46 PM, Rustygames wrote: Eggy Mario, link plz

close enough :P
http://www.youtube.com/eggy82

At 10/10/13 05:57 PM, MSGhero wrote:
At 10/10/13 04:27 PM, egg82 wrote: Though i've been doing two since Terraria is no longer getting views. Everybody's got the game, now :(
If we were near the same level in dota2, I'd suggest recording a game with me on skype. I get pretty heated when my team is bad, and they often are.

I'm awful at it, though I know how it works. I did a commentary once, but the video turned out like shit because I didn't set my recording software properly; so I never put it on the channel :(


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
Innermike
Innermike
  • Member since: Sep. 11, 2009
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to The Flash 'Reg' Lounge 2013-10-11 01:12:07 Reply

Interview for Junior Front-End Developer position next Friday.

The Flash 'Reg' Lounge


nobody

swishcheese
swishcheese
  • Member since: May. 12, 2007
  • Offline.
Forum Stats
Member
Level 14
Programmer
Response to The Flash 'Reg' Lounge 2013-10-11 12:44:06 Reply

At 10/11/13 01:12 AM, Innermike wrote: Interview for Junior Front-End Developer position next Friday.

Goooodluck man! Don't sweat it. Be confident.


BBS Signature
egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Supporter
Level 05
Game Developer
Response to The Flash 'Reg' Lounge 2013-10-11 18:53:52 Reply

I haven't been coding at all lately, ever since i've been putting out daily YT content. Once I start refining my system more i'll happily make room for videos, but currently even school and YT is a really tight squeeze O.o

Still working on that MC mod. Again, pretty much paused that along with everything else in my life >.>


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Supporter
Level 05
Game Developer
Response to The Flash 'Reg' Lounge 2013-10-11 18:55:22 Reply

At 10/11/13 06:53 PM, egg82 wrote: Once I start refining my system more i'll happily make room for videos

programming* - I'll make room for programming. Sonofabitch this is ruling my life xD


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Supporter
Level 05
Game Developer
Response to The Flash 'Reg' Lounge 2013-10-11 19:25:09 Reply

At 10/11/13 07:18 PM, 1516l wrote: http://www.youtube.com/watch?v=lscKfX1Fhlk

OOH, can I spam videos, too?! :D
https://www.youtube.com/watch?v=3ZXUI9zv8lw

Oh, yeah, that is me by the way.

Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Supporter
Level 19
Programmer
Response to The Flash 'Reg' Lounge 2013-10-12 09:55:07 Reply

At 10/11/13 01:12 AM, Innermike wrote: Interview for Junior Front-End Developer position next Friday.

Which company / location?


- Matt, Rustyarcade.com

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge 2013-10-12 12:42:32 Reply

At 10/11/13 07:25 PM, egg82 wrote:
Oh, yeah, that is me by the way.

You look less like your icon than I originally expected.

TheEnkian
TheEnkian
  • Member since: Dec. 18, 2012
  • Offline.
Forum Stats
Supporter
Level 19
Game Developer
Response to The Flash 'Reg' Lounge 2013-10-12 20:54:05 Reply

At 10/11/13 01:12 AM, Innermike wrote: Interview for Junior Front-End Developer position next Friday.

Good luck with it, I'm sure you'll do well.


Working on Enki Adventures, an action-adventure roguelike!
Enkian Games Website - For blog posts
Enkian Games Twitter For game updates
The Enkian Twitter - For personal tweets

PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to The Flash 'Reg' Lounge 2013-10-13 08:50:39 Reply

At 10/9/13 06:16 PM, Rustygames wrote: It certainly does sound interesting to have the systems automatically pick up on which VO's (components) have that data and then act upon them if they do. Presumably any changes would either be polled or the system would just fire some update event notifying the view components to redraw etc.

I can see the systems becoming somewhat hard coupled though. Allow me to use wikipedias example to illustrate a scenario:

"Another system could be a collision detection. It would iterate through all entities that have a physical component, as it wouldn't care how the entity is drawn. This system would then detect arrows that collide with monsters, and generate an event when that happens. It shouldn't need to understand what an arrow is, and what it means when another object is hit by an arrow.
Yet another component could be health data, and a system that manages health. Health components would be attached to the human and monster entities, but not to arrow entities. The health management system would subscribe to the event generated from collisions and update health accordingly. This system could also now and then iterate through all entities with the health component, and regenerate health."

The problem I foresee here is that you instantly have a hard coupled dependency between the health system and the collision system. The health system must update it's components on certain collision events.

Suppose the angle you hit a wall at is relevant to how much health you lose. That data would need to come in a payload from the collision event.

Now what if I want to take my health system and move it to another game where collision is not the system which health events are interested in, and damage is no longer calculated based on angle, it's based on how sharp the enemies sword is. I'm going to either add methods to health and leave some unused redundant code in there (very bad) or write a new health component (meaning the code isn't reusable).

Also I was wondering about systems editing many components and potentially conflicting since it's a bit of a free-for-all on them.

Please forgive me if I'm talking rubbish since I've never used the pattern before :)

In a proper design, you should only really have 1 system modifying components, but you can have several systems reading them.
Wikipedia's example is bad design :P
What I would do is the same up until the Collision. The CollisionSystem would add a CollisionComponent to both entities that just collided. Then, an ArrowSystem would be listening to entities that have a CollisionComponent and ArrowComponent, and then calculates the inflicted damage. It then creates a new entity, that only has a DamageComponent, which holds the amount of damage, and a reference to the target entity. Yet another DamageSystem picks up entities with DamageComponents, and then inflicts that damage to the target entity (who has a HealthComponent).

Which means in this case the DamageSystem is completely independent, it only needs entities with a DamageComponent, and target entity. Anything can generate damage at this point. The specific implementation comes in the ArrowSystem, which can be removed, and not affect anything, or in another game, you create a new System that would generate the entities with the DamageComponent based on different factors, w/e.

Btw, about several systems modifying several components, it either just naturally doesn't happen (if it does, it's usually just bad design), or if it happens to happen at some point, it doesn't really matter much.

In response to your example, the SwordSystem would take entities with a CollisionComponent, and SwordComponent, and then the SwordComponent would probably have a sharpness property you can use.

If something seems coupled, you just take an axe and chop it up until it's not coupled anymore!

P.