« first day (673 days earlier)      last day (4347 days later) » 

user4704
12:01 AM
@Gajet Yes, but what you say and what you demonstrate sound different, so.
 
user4704
Start by fixing any of the problems I just addressed.
 
@JoshPetrie here is my base logic class :
class BasicPlayer
{
public:
	virtual GameMap::MoveDirection getMove() = 0;
	virtual void setMap(const GameMap& map) = 0;
	virtual void updateMap() = 0;
	virtual void setPlayerID(int ID) = 0;
};
do you find anything wrong with it?
 
user4704
12:18 AM
Yup.
 
user4704
But I'm going home, I'll look at it later.
 
11:12 AM
Any one know how to detect particle effect was complete
 
 
3 hours later…
2:16 PM
I decided I'm buying and gifting the humble bundle for my siblings.. and I will force them to play AMNESIA!!! :D
 
2:39 PM
Well thats 4 bundles bought. Yay!
 
3:02 PM
@tylerrrr07 a family of 5 children,
quite rare nowadays!
unless you have same age as my fathers...
 
3:18 PM
4 children - bought one for myself :P
 
user4704
Beta weekend GO.
 
:O
If I didn't like Guild Wars will I like Guild Wars 2?
 
@JoshPetrie you were telling me what was wrong with my design
 
Then again... I think I played Guild Wars before it had any expansions...
Maybe I should give it a shot
 
user4704
@tylerrrr07 Maybe, it's quite different from a gameplay perspective. Most of the connection is in lore and a few iconic gameplay touchstones.
 
3:20 PM
Oooo
 
@JoshPetrie I also wanted to play GW but since it had no free trial I didn't.
 
user4704
It does have a trial.
 
user4704
It didn't at launch but it got one a little while later.
 
I played runescape just because it was free.
and it led me to get premium account for 3 months.
 
Runescape was good until it went 3D / freemium
 
3:21 PM
it still is very good
 
After that I got annoyed / bored - probably because I was like 14 and couldn't pay for a subscription
 
user4704
So anyway, your design. First it's unclear why some of that -- any of that -- needs to be virtual. It's nonobvious what "getMove" does. setMap implies the player owns the map (should be the other way around) as does updateMap.
 
user4704
setPlayerId sounds like something that shouldn't have a public accessor and should be initialized once in a constructor.
 
user4704
The class, as posted, is also more of an interface than a base class, since it provides zero functionality and only mandates implementations
 
@JoshPetrie actually I was also thinking about the player owning the map.
it's just for the ease of access.
getMove() is the think function.
setMap() tells the previous map pointer is not valid any more.
 
user4704
3:28 PM
The whole map thing is a wart.
 
user4704
And getMove is really poorly named. It also shouldn't be part of the player. It's a controller method.
 
updateMap() tells the class it has to change it's cache since the map is now completely different compared to previous shape
BBL
 
3:47 PM
@JoshPetrie the BasicPlayer class is actually the base for all thinking classes.
I mean the getMove is in the right class. but the class is poorly named itself.
 
user4704
No, I don't think it is in the right class.
 
user4704
But it is poorly named.
 
then what do you mean by the controller class
 
user4704
Your player class looks like it represents both an agent in the world, and the thing that controls that agent.
 
the player class asks the world world for whatever information it needs (based on its ID),
and reply to another class which is controlling the game flow.
 
user4704
3:54 PM
Yeah that's back-asswards.
 
never said it's a good design,
 
user4704
They stop asking me for what's wrong with it and then defending it
 
actually I'm asking how I can make it better.
and I'm not trying to defend it, I'm just suspecting you might misunderstood some parts.
 
user4704
I already told you; the player should not hold on to the world, and the methods that control an agent (such as a player) should be detached from the logical state of the agent.
 
logical state?
 
user4704
3:58 PM
position, current health, whatever. Anything having to do with the state the agent is in now, devoid of external controlling forces.
 
user4704
The ID.
 
user4704
The specifics don't matter much.
 
user4704
So you might have an agent class, which has position. it does not have a "think" function, it isn't a base class, it just has state and methods to sanely manipulate or update that state.
 
you mean I should have a class like this?
class PlayerInfo
{
	int mX;
	int mY;
	int mScore;
	GameMap* mMap;
	friend class GameMap;
	PlayerInfo* mTarget;
	std::vector<const PlayerInfo*> mHunters;
	bool mAlive;
	friend class GameMap;
public:
	PlayerInfo()
	{
		mScore = 0;
	}
	const GameMap * getMap() const
	{
		return mMap;
	}
	const PlayerInfo * getTarget() const
	{
		return mTarget;
	}
	const std::vector<const PlayerInfo*> getHunters()const
	{
		return mHunters;
	}
	const int getScore()const
	{
		return mScore;
	}
	void Initialize(int pX,int pY);
 
user4704
No. PlayerInfo is too specific.
 
user4704
4:01 PM
Any agent in the game, player-controlled or not, should be representable by the same core type.
 
user4704
Something like gist.github.com/2896445
 
they are all represented with that class. I've got an array of PlayerInfo along side array of BasicPlayer. whether the player is human-controlled or AI-controlled is based on the instance I Have in my controller array.
 
user4704
You don't need half that crap you've got in that class.
 
user4704
And that's disregarding the problems with the specific implementation you've got there, as well.
 
score, target, hunter, and alive variables are all part of the gameplay for every agent.
 
user4704
4:06 PM
Even non-players have a score? Either way it's irrelevant.
 
user4704
Anyway, then, to drive these agents you have controller classes, one of which (the "player" controller, typically) is connected to your input engine. Controllers drive a specific (or fixed set) of agents, and they are where things like AI would live.
 
user4704
The controller calls the public API of the agent to manipulate it.
 
user4704
gist: 2896445, 2012-06-08 16:03:25Z
struct Agent {
  Agent (const Vector3 &initialPosition);
  
  void LookAt (const Vector3 &target);
  void MoveTo (const Vector3 &target);

  private:
    Vector3 position;
    Vector3 facing;
};

struct IController {
  virtual void Update (float elapsed) = 0;
};

struct HumanController : IController {
  HumanController (InputSystem &inputSystem);

  void Update (float elapsed);

  private:
    InputSystem & inputSystem;
};

struct AiController : IController {
  AiController (const Script &script);

  void Update (float elapsed);

  private:
    Script & script;
};
 
user4704
oops, forgot the Agent& parameters in the constructors. But yeah.
 
shouldn't agent have a link to it's controller for owner ship checking?
what if I want to change some agent's controller?
 
4:14 PM
nah, you don't need a link
 
how do you handle changing controllers then?
 
Well, the controller knows about the agent, so if you want to change change controllers, you simply make a new controller (or use an existing one), and re-assign the agent to that controller
 
user4704
The agent should not change its controller. That's not its job.
 
user4704
The system that manages all the controllers can just create a new controller and assign the agent.
 
4:16 PM
In UT, they do the same thing, only they call "agents" Pawns
 
user4704
Consequently there is no need for the agent to know about it's controller.
 
user4704
Because that creates a coupling between the two interfaces.
 
user4704
(for no benefit)
 
when changing the controller I need to remove agents previous controller. so I should be able to determine what's the controller based on an agent.
 
user4704
Again, changing which controller points to which agent is the responsibility of the controller system.
 
4:19 PM
Do it like Josh and I are saying can make for some very sexy interactions. Like, in UT, there's the player controller that uses the keyboard/mouse as input, and it can attach to the Soldier Pawn and let you run around. When the soldier pawn runs up to a vehicle and gets in, the controller detaches from the soldier pawn, and re-attaches to the vehicle pawn, seamlessly
 
user4704
So the thing that manages the controllers can deal with that.
 
user4704
Also, you are assuming that control one controller can control an agent, which doesn't have to be the case.
 
And when you die, the controller detaches from the soldier pawn, and attaches to a free-cam pawn until a new body is made for you, and you re-attach to the new soldier
@JoshPetrie true
 
user4704
(although you probably have to be careful there or you can get some amusing results)
 
In my game, I have Controllers and Forces (as in an army), and a single controller can control multiple forces
 
4:22 PM
I'm just wondering how I should find out who was the previous controller of an agent? should I go with a linear search between all controllers for example?
 
Agents shouldn't know anything about controllers
anything
 
user4704
Somewhere, you have a thing that has a list of controllers. If you need to know which agent is-owned-by which controller, you create a mapping between agent and controller at the same level
 
@JoshPetrie so you mean I at least need a binary search to find someones controller?
assuming that agents are sorted based on the pointer address?
 
:/ I can think of only 1 case where that might be useful: An out-of body experience and the body dying, like if you're playing UT, and you are controlling the camera-guided rocket and someone stabs you
but really, I don't think you'll need a reference from the agent to the controller
 
@JohnMcDonald the whole point of this coupling is to reduce lookup time in cases like that.
 
4:28 PM
Name a case
You'll find you won't need it
 
in my game, every player tries to hunt another player.
 
Yes...
 
user4704
@Gajet You need a map lookup; this can be O(1) amortized (hash)
 
reviewing the history, this reminds me of a convo I had with Mindworx a long time ago
completely agree on the game-entity versus controlling-entity thing
 
Each agent has a target agent. Each controller is controlling a single agent. .. that's really it
 
4:30 PM
@Gajet in the simplest case, you can have the controller entity just keep a reference to the game entity it controls
 
@JohnMcDonald when someone reaches it's target, it notices a collision between it's agent and target agent.
and in result it should notify target agent's controller about the collision.
 
@Gajet yeah... but that still has nothing to do with the controllers, so you're all good
 
user4704
That's irrelevant to the controller/agent distinction.
 
user4704
And it should not notify the controller.
 
Why does the controller need to know about the collision?
 
user4704
4:32 PM
You're failing to grasp the fundamental point here: agents should not know about controllers.
 
user4704
If you have a case where you believe they should, you are doing something else wrong.
 
it's like saying a worker should not know who his boss is
 
user4704
No, it isn't.
 
user4704
The controller is about transferring external inputs (from a human or AI or recorded game session, for example).
 
user4704
4:33 PM
It does nothing else
 
user4704
So it should not need to know about collisions. That is something else's job.
 
user4704
If it does for some reason, there are ways to do it that still don't involve the agent knowing the controller.
 
collisions change everything, specially for the AI.
 
user4704
Not for the controller
 
but still now I'm looking I don't have those kinds of data in my PlayerInfo class
 
user4704
4:35 PM
PlayerInfo is still a horrible name and the class you posted is still full of horrible things.
 
user4704
Such as being friends with the game map
 
user4704
Transition to an agent and controller model as we have described, it should not be a huge change
 
yeah, when I did it for the first time, I was surprised how easy it was
Sounds complicated, I know, but it's actually really simple, and powerful
 
a worker doesn't need to care who his boss is, if you want your organization (program) to be maintainable
someone tells him what to do, and he does it. If he moves to a different department, he still does what he's told to do. He doesn't keep a reference to his old boss.
 
user4704
Real-world analogies break down very quickly when building proper OO-designed constructs.
 
4:41 PM
and collisions should not be in your foreach entity -> update() loop honestly
if you are checking collisions there, it encourages a bad "well, i'll just respond to this collision now" tendency.
 
@JoshPetrie it really is not. in fact now I'm thinking I almost have same model
and about why GameMap was a friend it was for the sole reason that GameMap is responsible for all agents (it owns them). And it's responsible for hunter/target variable.
now I'm thinking the main problem really is my naming, IController is the same as BasicPlayer in my code expect m basic player also have a pointer to map (which should be removed)
and PlayerInfo is exactly the same as Agent in your code. With all other data it needs to represent complete features of game play.
 
user4704
...no, you don't.
 
4:59 PM
I'm still looking for differences.
I mean I've got setPlayerID in my controller class which is identical to the Agent& you pass to controller constructor in your code.
and my playerInfo class doesn't have any reference to it's controller as you suggested.
the only difference I can spot is the fact that they both have a pointer to the GameMap.
 
some rules of thumb (completely without context) :
friend is usually a bad sign
lots of inheritance is usually a bad sign
both of them imply that you're relying on nonpublic properties of a class
it just tends to increase coupling
 
user4704
setPlayerId is not identical
 
@JoshPetrie my map class has a const PlayerInfo& getPlayer(int id)
so whenever a controller needs to get information about whoever it's controlling he asks for it's playerInfo
it also helps the network controllers to send information about all other players over the net in their update function.
 
user4704
Yeah, well I'm not going to waste my time arguing with you if you're just going to blithely dismiss everything.
 
so far I've learned I should remove all the coupling in my classes (and of course the friend part)
but I can't see why setPlayerID is not identical with setAgentRefrence?
 
5:14 PM
well, for one, it's not obvious what it does
 
each agent has an ID, and it's saying which agent should this controller affect.
 
well basically, why does your controller need to know where to retrieve the player info from?
suppose your entities wind up being stored outside the GameMap at some point
 
HumanController sure doesn't need to know.
AIController might make different decisions based on other players score.
and there is a netPlayer (which is going to connect to some other game instance over the net) and it needs to send whatever data other instance needs to know about the game
 
netplayer should only send data about the player
 
@Jimmy it should send data about other agents too. How else can other instances show all the agents in rendered image?
 
5:26 PM
why should a controller for an agent send data about other agents?
 
IMHO it makes everything easier. The controller also stores information about connection. It sends whatever information it's client needs. and receives (and reports) the action it's client is doing.
this way there is no need for another communication controller class.
 
that's no longer a "controller"
if I talk about a controller, I'd imagine a class that only implements the functionality required to send or receive messages from an entity
or perhaps just send message to the entity
 
if I'm not wrong the controller we were talking about, was handling all the logic an Agent had. (or am I wrong @JoshPetrie)
 
a single Agent
such as player character
or an enemy character
the code for it should look like game logic.
for that one agent it's working on
 
so you prefer introducing another class to handle network communications.
 
5:38 PM
yes
 
I can't get how it can reduce complexity.
 
for sure.
because each class needs to handle one thing
your controller handles routing messages from something to an agent
 
I mean networkController almost doesn't do anything anymore
 
your network component handles sending packets over the network
@Gajet of course, it's perfectly fine to have a 20-line class
I mean, what if you need to switch from TCP to UDP? What if you want to use RakNet? what if you need to route messages over HTTP Comet (bear with me)?
it would be great if you could just change your implementation of networkcompoennt
from a TCPMessageSender to a UDPMessageSender
 
And your networking code is likely going to handle more than just the communication between a single controller, or single agent
 
5:43 PM
or if you need to change your serialization from XML to Protocol Buffers
 
are those things should be handled in another class. I mean I complete a form and ask another class to send it for me.
but the form is filled out in controller class in my method.
@JohnMcDonald what do you mean?
if multiple agents join to a server, I need to send data for them separately and try receiving whatever they request separately.
 
You were thinking about implementing network sends/receives straight inside a controller, and I was saying that you'll need network sends/receives in other places. For example: connect/disconnect
yeah, but you shouldn't have a connection for each agent
Usually, a single connection will work for the entire game, and each logical packet is an instruction that the game understands
 
6:05 PM
Yeah I don't get entity / components :(
I feel bad because Josh and I had a great conversation on it and I feel like I wasted his time because I just got confused when I tried to write code based on what we talked about
 
@tylerrrr07 so the last game you wrote you went with the GameObject method?
the class GameObject { List<GameObject> Children; } thing seems to be the typical "simplest way to do things"
 
@JohnMcDonald that's in client side.
in server side you need separate connection per client
 
true, the server will need 1 connection per client
 
hi
all
 
all those network controllers are in server side. client side manages everything in a complete different system.
 
6:12 PM
why use 2 systems?
 
i want to learn OpenGl for android game development can anyone please suggest me some help on that
/???
 
@JohnMcDonald every thing changes in client side.
how the map is created, how orders are take action and everything.
@tylerrrr07 exactly my problem :( as long as we are talking I can keep track of what he says but when it comes to implementation I can't understand why my method is not the same as the one he suggested.
I mean I can see I've got some things wrong in my code, but I can't find a way to fix them while having same structure he suggests.
 
yeah, I would still have a layer of abstraction to separate each client connection from the client's controller on the server. There are likely messages that you haven't thought of that come from a client's connection, but have nothing to do with the controller. Like a chat message
 
you are right, chatting was never in my plans.
 
@Goofy I'm not personally able to help you, but I'm pretty sure whoever will be able to help will need some additional information such as: 2D/3D, past programming experience, etc
 
6:18 PM
but still I prefer to put a function for chatting in my controller class.
 
why? the controller should be a controller
You're just reducing the Cohesion
 
let's say I'm putting every thing an agent needs to do inside it's controller.
sending/receiving messages is part of the things an agent should do.
 
6:35 PM
But handling chat messages isn't something an agent needs to do
And does the agent care if/when the client disconnects?
 
@JohnMcDonald connect/disconnect is reported to classes which manage controllers.
 
So now the controllers contact the controller manager?
 
there is a controller manager
it asks controllers if there is anything wrong, and they might reported true or false
 
:/ that just seems out of role
 
you mean controllers should not report if anything goes wrong?
 
6:42 PM
Well... is there an other reason that communication line is there? or is it only for network disconnects?
 
I didn't really think about that.
 
If it's only for network disconnects, then the controller manager may as well be asking each controller if they've been disconnected, which makes no sense
 
7:04 PM
@Jimmy Something like that. The last game I made was REALLY bad code TBH and I'm trying / doing better this time but my game objects definitely have some (though not too bad IMO) inheritance and tight coupling between things.
Its functional and flexible enough for my needs at this point in time. I'll adjust my design a bit as I go though
 
7:41 PM
Now that I think of it... why wasn't this question down voted / closed?
4
A: Alternatives to a leveling system

tylerrrr07As a forewarning - this is kind of redundant with your own answer but with different terms and a slightly different implementation. Also I don't really have a good idea of design for your game so some points may not be relevant. The first thing that popped into my mind was to implement some sort...

whoops
linked my answer... oh well
Look at that good looking guy! ^_^
 
yeah... I was wondering about that as well
 
I know when I got around to answering it Tetrad had already looked at it and it had 1 upvote
 
7:54 PM
I think it's a good question
technically it's too discussion oriented to SE
 
I agree on both your points
There is no real "correct answer"
I saw this question and @JohnMcDonalds comment and thought "Oh snap."
 
but the content is good. Brice's answer is nice because it discusses a list of alternatives
 
-1
Q: Ideas for card deck names

Milan BabuškovI'm creating a card game, and wish to offer players to choose from different sets of playing cards. The game logic remains the same, only the design and graphics on the cards would be different. It would feature classic French set, German/Hungarian one, and a bunch of other custom designed ones. ...

 
that's not a game development question
that's a "come up with names" question
 
7:56 PM
you could substitute "I'm creating a card game" with "my dog had a bunch of puppies"
 
Well, it was more Johns comment that got me thinking, not the question itself
 
Bane's question has valid answers
although none of them have to be "more correct" than any other
"come up with a name" has no factual answer
 
It's opinion based though because its which one does he like best
 
yeah, my comment came from a glance at the FAQ: gamedev.stackexchange.com/faq#dontask
 
"What are game mechanics that are not XP-based" has factual answers
whether you like them or not is opinion
 
7:58 PM
Which one he picks is
and...
 
well, he could CW it if he doesn't have a good answer to pick, but I don't think that's necessary
like, "how do I scrape an HTML field in Python?" could be answered with "regex" or "BeautifulSoup"
 
Yeah
I guess even more concerning is the scope of the question
"Is there another way of progression in games, aside from leveling and XP points, that wouldn't get rendered redundant by my money mechanic, would be somehow meaningful (even on a symbolic level), and wouldn't be in conflict with my last point, which is simplicity?"
 
that's a bad wording
progression mechanics are a way for player engagement.
 
You make a good point
This question could probably quite easily be rephrased to be more generic and it would fit nicely
 
all game design boils down to is really only a few aims
1) how do I keep my players playing the game
2) how do I let them enjoy playing the game
discussion about mechanics, IMO, is a great subject for gamedev.
as long as it doesn't devolve into "why does everyone hate THAC0" type of discussion
 
8:04 PM
For sure! Which is why I was excited to answer.
 
yeah, that makes sense
 
I just realized I answered rather specifically to his situation because his question was worded in a way that it was specific to his game
So now it feels dirty
Though anyone with any imagination could apply my answer across other genres as well
 
I love the licensing idea by the way
 
I think we can just agree, now that we've had this conversation, the question is good and just needs some cleanup
and thanks!
As my answer states... I kind of stole the idea
but it is what it is
 
 
1 hour later…
9:10 PM
That is all.
 
"Tutorial
We will publish the video tutorial on BWAPI bot creation for beginners here soon."
:(
 
Doesn't make the matches any less interesting to watch...though I do wish streams were available from both POV's.
 
9:26 PM
I wonder if something like that, but with WC3 would be something people like.
With the hacking I've done, adding a C# controlled AI is trivial.
 

« first day (673 days earlier)      last day (4347 days later) »