« first day (542 days earlier)      last day (4463 days later) » 

12:14 AM
I've had a bank statement sitting on my kitchen table for a month or two. Kept meaning to get to it, but I've always been sort of busy and never really got around to it. Finally opened it just now.
It's dated Nov 2009 -> May 2010.
Guess it's been sitting there for longer than just a month or two.
 
lol
 
 
1 hour later…
1:28 AM
Hey: A stupid question. What's the formula for calculating what time does it need to elapsed since last shot, when I know that there should be 600 bullets per minutes shot ?
 
1:54 AM
600 bullets / 1 minute == 600 bullets / 60 seconds == 10 bullets / 1 second == 1 bullet / 0.1 second.
Yay, unit conversions! xD
(in the above, pronounce '/' as 'per')
 
2:45 AM
Ehh... components are fun, right?
Maybe I'm doing it wrong, but I have "components" that create and use other components, no problem there, it's rather cool actually. My components can either be a part of the "game" or be a local component that will either never be a part of the game, or will be added to the game later on.
The problem is that when I create a component, it needs to be added to one of those two lists: Game Components, or Local Components, and only the creator of the root component knows where the components belong.
I still have an Entity component, and the Entity wants 2 more components (more to come): PositionComponent, and SizeComponent. Right now, these sub-components are created inside the Entity itself and then... I'm not sure how to add them to one of those lists.
You know what? this is probably long enough, and detailed enough and I should just make an actual question
 
3:16 AM
I'd put those sub-components into one of the main lists, and store a local reference to them. Basically, make components reference-counted.
(Actually, maybe not. That was my immediate reaction, but I can see how it might not work for a full game implementation)
 
hmm, I'm thinking that I should pass an IComponentList or something to the components' constructors
 
What would you do with that?
 
So any sub-components call an "AddComponent" method in the interface
Then the interface could be implemented in 2 places, my "game" list is stored in my Game class, and my "local" list is in my HUD, so they are 2 different classes
man, Flash has been crashing a lot for me recently
so yeah, I'm gonna try the IComponentList... or IComponentManager? But it's not really a manager and I hate that word
 
Hm.. I know that using "this" from a constructor is dangerous in C++. I assume the same is true in C#? (I seem to recall that you're using C#?)
Lots of people hate managers.
 
Actually, using "this." from the constructor isn't a problem, it's only if you're accessing a virtual method that is accessing members that haven't been initialized yet
C# always constructs things from the bottom up, so by the time you can use "this", all of the base constructors have been executed
 
3:33 AM
Yeah, same in C++. In C++, the vtables for virtual function calls aren't fully set up yet in the constructor. Or they're not guaranteed to be. I never remember whether it's guaranteed one way or the other; the whole "'this' in a constructor" thing is firmly in "don't do that"-land.
 
Hmm, ic
You talking about passing a reference to yourself, or even setting a member variable like: this.myVar = 2;?
I use this.myVar = myVar; all the time in my constructors, and I am pretty sure that is encouraged in C# as opposed to: m_myVar = myVar; or even: _myVar = myVar;
 
this->myVar would be okay. (the 'this->' is implicit, after all). But passing the 'this' pointer around is a bad idea. Especially if something's going to be calling virtual functions on it.
 
Ah, right... That's a good point.
That could be dangerous
 
Slowly getting AI combat working again. Now AI monsters are chasing and attacking AI players again. The AI players aren't noticing yet, though. And when they die, they aren't teleporting back to a spawn position, for some reason. Yay, bugs.
 
in my case, I'm not making any components in the constructors of either of my IComponentList implementors, so that should be good
heh, some good, some bad
I've just been pounding away at this component system really
 
3:39 AM
Trying to decide whether I need a second state machine on my AI players. So like one for "general goal", and one for "active activity". Or whether I'd be better off with a hierarchial state system, so that my "grind to gain a level" goal can just push on a "fight this monster" state, which pops itself once it's finished.
Or whether the "grind to gain a level" goal should just turn itself off and switch into a "fight" state, and then once the fight is over, re-evaluate to decide what goal/state to activate next.
 
hmm, I... have no idea, but have you're reminding of some stuff I read on Darwinia recently
 
@TrevorPowell I didnt know that pass this pointers around is bad lol, everyday learning something about C++
 
Gtoknu: Only bad from the constructor. :)
 
ya
 
And then only really bad if the class has virtual functions.
 
3:44 AM
vtable, huh?
 
vtable.
I have all the combat code written. Just trying to figure out the nicest way to activate it and get it called every frame. But I've got lots of places where I might want to use it.
 
4:25 AM
Compile, errors: 12, fix, fix, fix, compile, errors: 14
sigh
(actually, it's been 12 for the last N compiles, it's really weird)
 
4:40 AM
So yeah, this interface idea is working. Now I just have to figure out how to transfer something from being local-only to being a part of the game. I need it to transfer (or just re-create) all of the sub-components
:/ great, I have a memory leak with these components
 
Memory leak with C#?
wow
 
Yeah, it's when you continue to refer to something after you no longer need it
Even listening to an event will do it
 
Ah
 
In my case, it's when a Component that has sub-components dies. All of the components are in a list and actually usable by other components, and this is a feature. So multiple components can share the same PositionComponent and effectively be always moving together (like a unit and the health bar)
But right now, I have no way to track who is using which component, so I don't think I can safely delete sub-components from the component list
 
already minded any fix for it?
 
4:53 AM
hmm... I'm trying to think of a case where I actually want any other components to be using the sub-component after death of the "primary" component
wow, that wasn't confusing at all
 
Mm. It's tricky in your situation, John, because you have "Entity" as a component. And when that dies, it makes sense for it to take everything with it.
 
.. yeah
 
If you were making your components smaller than that, you might find situations where you did want components to persist, after the ones which created them died.
But with an entity there which owns the whole lot, I agree -- I don't see any reason why you'd want a component to live longer than the entity component that owns it.
 
yeah, and what do you do in those cases? Do you have to add a counter in each component and increment it each time a new user comes along, and decrement it each time one of the users dies?
I'm thinking of a scenario now, where you could have multiple references to the same "animator" so that all of the entities will look the same in every frame like in Mushroom Wars
I don't plan to do that, but when the last entity that is referring to the animator dies, I'd imagine the animator would too
 
Reference Counting, yeah. That's a pretty common approach.
 
4:59 AM
anyway, if and when I need that, I think the counting would work
yeah
one step at a time
 
Yay, combat is working again!
...except that they're not being given credit for kills. Bleah. :(
 
heh
awww
 
huggles Mr. Powell You'll get it to work.
 
But using attacks and heals and stuff is at least working again.
 
That's good
 
5:12 AM
So. Now that this is all separated out properly.. I guess that XP should probably be awarded by monsters, instead of players awarding it to themselves for defeating a monster. Because the player class no longer knows which monster it's attacking. I guess monsters need to keep track of who has done damage to them, so that they can award the XP/kill credit when they die.
 
Hmm, interesting. The player doesn't know what they are attacking? So I guess the weapon does?
but at the same time, it makes sense that the monster keeps track of who has dealt it damage so that it can distribute XP appropriately
Heh, now I have an unforeseen little graphical feature. There are like 32 versions of my structures that you can build, they are basically the same thing, but at different angles to the camera to create some verity. I have a "ghosted" version of the structure in the local world for when you're about to build, and when you actually build I used to just move it over from the local world to the game world so the animation rotation would be what you saw
Now, instead of moving from local->game, I'm just making a new one in the game world and potentially just deleting the local one
 
Yeah. Previously, (when the AI was in the same class with the player), XP was self-awarded, because the player class knew what it was trying to do. Now I need to switch that around, I think, because the AI knows who it's attacking, but the Player class doesn't. And the AI could award XP, I suppose, but then a human-controlled player wouldn't have an obvious way to receive XP.
 
So the graphic is re-randomized and looks different than the one you were looking at
@TrevorPowell hmm, ic
 
Are they sprites, John? Or 3D models?
 
Umm, sprites... of 3D models
 
5:19 AM
I'd have two constructors, John. One specifying the variant to use, and the other letting it be randomised. So for the local ones, you let the variant be random. For the real world ones, you pass in the variant chosen by the local one. ;)
 
yeah... I could do that
it also means that I have to enable a way to access the variant
but that's doable
 
And then ideally, you have those constructors both implemented by calling a private member function which takes the variant and then performs initialisations and loading and whatever. So you're not actually duplicating much code.
 
I'd forgotten how much game logic is on the monsters. :)
 
It gets that way, doesn't it?
 
5:23 AM
Periodically checking to make sure that they're an appropriate type and level for the area they're in.. and that their spawn positions aren't too close to a road or city or whatever, and lodging requests to be moved elsewhere, if so..
 
yup
Well... I think I've made my last change for the night. Everything is working except multiplayer (I think)
actually... I'm going to run a quick test to see if that still explodes
BOOM, yup, still broken
 
Aww.
I know better than to attempt multiplayer in my game. I might have some network support at some point, but not multiplayer. :)
 
But wait... this is an easy fix, let's see if it explodes in a sec here
yeah... I've always loved multi-player games and have tried a number of times to get networking working right, and I think I may have finally done it
(not "finally" as in tonight, "finally" as in with this project)
 
I've done multiplayer before. But trying to do multiplayer in a game about MMOs just sounds like a disaster waiting to happen. ;)
 
Well... it's close, but the Asteroids aren't visible on the client for some reason, and it hits an assert on the server when I try to build something on the client
Meh, it's close
close to being back into working order
And not only do I love multiplayer games, I also enjoy a lot of networking concepts. It's pretty fun, albeit tough to get working properly in a game
It's a little bit easier when the player can't control any moving objects
or at least that's what I tell myself
 
5:40 AM
My favorite thing ever was synchronising the traffic lights between players in an online racing game. :)
 
hah, awesome
Yeah
Clock synchronization has come up a number of times on this website
 
Just synchronise the game time, and have the status of every traffic light in the game be deterministically set according to the current game time. ;)
Yeah, exactly.
 
Yup
As long as everything refers to the game time, everything just... works
It's hard to explain that though
actually... kinda funny, but in my game I haven't dealt with any clock sync yet, but I do at least know how it works and where I'd have to change some code
alright, I'm out of here, gn
 
5:56 AM
Good night!
 
 
4 hours later…
9:33 AM
@TrevorPowell c If I had some random stuff in my game, would sharing the same seed across the clients be enough?
 
Damir: Enough for what?
 
For netplay. To make sure it runs deterministically.
 
If all clients were using the same random seed, and you could guarantee that all clients requested the same random numbers in the same order, then yes.
Many strategy games will do things like that in order to have all clients generate the same starting map, for example; instead of having the host generate the map and send it to all clients, just have the host pick a random seed and send the seed to everyone, so they can all generate the same starting map.
But be very careful; it's very very easy to have one client request a random number for something unrelated, which can result in the whole RNG synchronisation going out of whack.
There's an old story about a desynch that happened in Age of Empires whenever you selected a particular type of unit, because the game generated a random number on the client side to determine whether or not that particular unit would play a sound effect when selected. And only the client who clicked on the unit would generate that random number, causing all the rest of the random numbers to go out of whack
(Er, that's during the development of the game, not in the released version)
Games which want to synchronise random numbers usually keep two separate random number generators, one for synchronised "important" random numbers, and one for local-only unsynchronised random numbers, which is used for things like unit selection sounds.
 
 
1 hour later…
10:49 AM
@JohnMcDonald just implement IDisposable on your entity. When it gets disposed just event=null all the events. Leave the garbage collection up to the GC. Alternatively use weak events (codeproject.com/Articles/29922/Weak-Events-in-C - look for SmartWeakEvent).
NEVER try get smarter than the GC. We tried it on a thick client, essentially, flow chart designer and caused more issues and headaches (we used ref counting etc.) Just cleaning up any events on Dispose() sorted us out (remember Dispose() can be implemented WITHOUT a finalizer - especially if you are not controlling unmanaged resources). This took us from 2GB to 200MB after an hour of use.
Just be careful with weak events: as if events are what you are using to keep things alive you will have a nasty surprise.
 
11:06 AM
I think I have too much surface clutter for a game with user-modifiable terrain. Rebuilding all that clutter kills my frame rate. :(
 
@TrevorPowell 'surface clutter'?
 
Extra objects that just sit on top of the terrain. Plants, rocks, things of that sort.
Visual clutter.
(which sit on top of the terrain, but serve no gameplay function)
 
oh right, like doodads? got a screencap? maybe I could throw in some ideas.
 
Hm.. let me see if I have one handy.
But really, I just divide my world into tiles. Right now they're 32x32 meter tiles, and when the terrain is modified, I rebuild any clutter data for the tiles that intersect the bounding box of the modification. Each tile contains its own VBO/IBO which gets built according to the updated heightmap data.
I suspect it's just too much changing geometry for the amount of terrain deformation that I'm supporting.
 
 
3 hours later…
2:36 PM
@TrevorPowell really love that screenshot
specially the mountains
 
 
3 hours later…
5:38 PM
@JonathanDickinson, The problem is that I have a list of components, and they need to be in that list in order to be updated or drawn, and that my components can be used in other components. I think of a case where I'd really want this, but hypothetically I have an EntityComponent that has a PositionComponent, and then I have a HealthBarComponent that shares the same PositionComponent.
So now, when the EntityComponent dies, I'm going to clean up the PositionComponent and send out a death notice to which the HealthBar is listening and know to kill itself too. BUT in a case where I don't actually want the HealthBar to die, there would need to be some way for the shared PositionComponent to stay alive
*meant to say "I can't think of a case where I'd really want this"
 
 
1 hour later…
7:00 PM
hahaha, awww. I was trying to track down this multiplayer bug I have, and I just figured it out (yay), but it requires some more thought to fix (boo)
 
@JohnMcDonald what is the game you currently are working on/
 
I think my Clients will require the authority to give out IDs to their own objects, :(
Asteroid Outpost: cell.stat-life.com/…
 
7:17 PM
is there any beta/alpha releases out there?
 
It requires .Net 4, and XNA 4. I would stay away from the multi-player, and the tutorial is shambles.
better yet, there's a video I made of it: youtube.com/watch?v=Q8pR9KDBsCo I'd just watch that, unless you really felt like playing, :)
 
I'll just do anything to avoid working on my project!
 
heh, that was funnier when it read "project1"
If you play the endless mode, bad guys will always spawn at the same location
and there are a handful of power-grid related bug that I fixed: trello.com/board/asteroid-outpost/4eea54e2c4f63df65d119595 so don't try to upgrade your first solar station
(or just download the latest and greatest version from SVN and all will be solved)
 
i'm donwnloading the same link you provided
 
k
alright, I'm out to run some errands. If you come across any bugs that aren't listed on Trello and aren't related to the Tutorial or Multiplayer, write them down somewhere and I'll be back in a bit.
 
7:43 PM
I've just found out I've had an account on trello!
 
8:05 PM
well, fixed two of the worst, and most likely, crashing bugs
 
8:19 PM
@thedaian yay!
I'm guessing uuuuuuuuuuuuuuu was one of them?
:/ well that sucks, The Bike Shop is closed on Sundays. I guess I'll be doing that tomorrow
bbl
 
can anyone please tell me how can these texture COORDS result in skewed texture?
base.vtx.tex0((i*(height+1) + j) << 4 | 0x0) = Vec2(0,0);
base.vtx.tex0((i*(height+1) + j) << 4 | 0x4) = Vec2(0,1);
base.vtx.tex0((i*(height+1) + j) << 4 | 0x8) = Vec2(1,1);
base.vtx.tex0((i*(height+1) + j) << 4 | 0xc) = Vec2(1,0);
and here are the triangles:
base.tri.ind(triNum--) = VecI(((i+0)*(height+1) + j) << 4 | 0xc, ((i+1)*(height+1) + j) << 4 | 0x8, ((i+1)*(height+1) + j) << 4 | 0x0);
base.tri.ind(triNum--) = VecI(((i+0)*(height+1) + j) << 4 | 0x4, ((i+0)*(height+1) + j) << 4 | 0xc, ((i+1)*(height+1) + j) << 4 | 0x0);
 
@JohnMcDonald yeah, i added a lot of stuff to improve the elevator 'up a floor' thing, and solved the uuuuuuuu bug in the process
 
8:55 PM
yay fixed!
 
yay for fixing things!
 
I've already said creating meshes using bare code sucks!
but know I've found out placing vertexes is not even a match for organizing texture coordinates.
 
My first rendering engine a couple years ago randomly generated all the vertices for a block maze
But that wasn't too bad since it was just a bunch of quads
 
I'm generating a maze too,
but to put textures correctly, god help me!
 
Haha, what kind of shapes are generating?
 
9:05 PM
w8 for screenshot
though there is still too many triangles to create
 
You are having troubles texture mapping the quads?
 
yeah texture mapping
BTW they are triangles not quads
 
It shouldn't be too hard. With a right triangle facing you, the top left corner is 0,0, bottom left 0,1, and bottom right 1,1
 
oh my
 
yeah I know the theory,
 
9:10 PM
that is why i don't do 3d
 
The hardware sampler should take care of the rest.
3d is fun!
 
but it's not helping me at all
 
I couldn't cruise around a solar system at sub light speed in 2d!
Hmmm
 
ha?
where did that came from?
 
Oh sorry, was rambling at daian
But yeah, I can't tell what is wrong. You must be messing up your uv coordinates somehow
 
9:14 PM
@thedaian I'm with you all the way
 
Looking at your code up above. It looks like you're doing some kind of crazy bit shifting/multiplication. All the triangles should have the same uv coorindates
 
Speaking of 3D, I'm tempted to make my Asteroids have a Z coordinate that will create a fake-3D effect when you move the camera around. I think it could look really cool
 
MOAR DIMENSIONS!
 
@KlashnikovKid they don't
 
but first, I want to fix this ID assignment stuff, :(
 
9:18 PM
every piece of the wall should be able to have special part in texture
 
That would be your problem. Is there any particular reason why you want different UV coordinates for the surfaces
Aaaah
Gotcha
Well, it must be how you have that texture mapped.
 
and if that wasn't the case, I still had problem with tiling same texture
 
And making sure the shared vertices of the triangles that make the quads have the same coordinates.
 
yeah
 
Hmm
Could texture coordinates not being making it into the pipeline correctly or are you transforming them or something?
 
9:22 PM
I don't think so
 
I once had a bug were I mixed up my normal and tex coords cpu side before sending them to the gpu
 
there is some problem is the existing uv coords.
I'm using a gameengine, so that can't be my case!
 
Ah, yeah. No clue then.
 
9:40 PM
screen shot update:
it's just funny that you try for hour to something. when you just step once, the rest is done in just 10 mins!
 
Haha yeah, I'll spend a day on something and then come back the next morning and figure it out in like 30 minutes
 
9:59 PM
Crap. I was hoping to use an ID for my entities where the top N bits would be used for the player's ID, then the lower bits for the component's ID within that. But guess what? I've implemented an Actor/Pawn like in Unreal (I call it Actor and Force because it's plural) and neither the Game nor the Component know which Actor is controlling them! The Component does know the Force, but a Force can be controlled by multiple Actors.
:/ I guess I need to pass the controlling Actor into the AddComponent() method? That kinda sucks
 
10:11 PM
ehhhh, then I'd need to pass the Actor into all of the Component constructors because they can make other Components and have to call AddComponent() for each of them.
 
That just hurt my head
 
heh, which part?
Actors and Pawns are really cool
 
I've never used the unreal engine.
 
Nor have I
 
I use Actors and Prawns
 
10:14 PM
Umm... trying to find an article about it
 
Is an actor just like a game entity that is influenced by something?
 
Meh, I can't find anything right now, but the concept is really easy to explain and is more powerful than you'd imagine
So... An actor is either a player, or an AI, something that can control a Pawn.
 
Gotcha
 
A Pawn is something that is controllable
 
Yeah, makes sense
 
10:18 PM
In UT, You are an actor, and you start off by controlling a character Pawn. Then lets say you're running around and hop in a vehicle. You current pawn hops in the vehicle and attaches to it, your Actor disconnects from the character Pawn and attaches to the Vehicle pawn
phone
 
Gotcha. Actor allows the pawn interface to be indifferent to who's controlling it. I was basically going in the same direction with my game and switching ships
Just didn't know the nice UT terminology. :P
 
So that's cool, but what's even more fun is when you die! Your character pawn dies, and your Actor attaches to a Camera object and waits for a brand new character pawn to spawn and then attach to that and away you go
It's really nice to design the AI with the same interface as the Human counterpart would use too
 
And it allows you to easily switch stuff around. So like in Armagetron, if you are afk for more than 30 seconds, it'll replace your actor with an AI actor until you get back, then seamlessly swap you back in
 
Never occurred to me to do it any other way. Though I may be letting the player cheat at the moment since he doesn't have to deal with inertia (yet!). Input maps straight to velocity.
Yeah, that's nice
 
10:24 PM
Nice
So yeah... my Components have no idea who or what is controlling them, as it should be. They could look it up, but there could be multiple Actors controlling the same Force (as per my design)
That allows for cool stuff like 2 players sharing a force and having full control over it
 
Like a tank or something? Gunner and driver?
 
Well, I'm writing a strategy/tower defence game, so both players could build units for the same force, and upgrade buildings that the other player built
 
Aaah gotcha
 
But... you could design a tank that has 2 drivers, that would be neat
And hilarious
 
Hahaha
More like a rowboat game!
Make em take turns coordinating and paddling
 
10:28 PM
heh, yeah
Coop or DIE!
 
Hahah
 
so anyway, I've found an other solution to my problem. Instead of using the controlling actor's ID in the mix, I could just hand out the starting ID to the client(s) when the server starts. Problem solved
 
10:53 PM
Yay, it sorta works now, except the second player can only build stuff if it's connected to the first player's power grid, lol
 
haha, nice. Debug exe size: 9mb. Release size: 2mb
 
heh
sigh, problem after problem. Where on earth should I make my PowerGrid if I'm making it force-aware?
I suppose at the same time I create the force? But then it's up to the Scenario to make the PowerGrid, and is it really the Scenario's job?
 
Use The Force, John
 
check
// May the
public class Force : ISerializable
{
	// be with you
 
lol
 

« first day (542 days earlier)      last day (4463 days later) »