« first day (544 days earlier)      last day (4466 days later) » 

12:53 AM
Is there any way to profile shaders? I'm trying to figure out what the bottleneck of my lighting system is.
Like, does it help to decrease the size of the textures transferred. Or is it the calls and not the data that slows down? Or is it the actual work of the shader?
 
I'm not aware of good ways to profile shaders; it's pretty much a case of "try lots of things, see which ones improved the frame rate".
 
1:39 AM
Goal for the night... get collisions working properly.
Or at least really close
 
Oh snap, I'm still in this room. I thought I left hours ago.
swoosh
 
@tylerrrr07 Nice, now you scared someone away
 
eh... no one of importance at least :P
 
2:26 AM
@TrevorPowell 4th floor in japan :p
 
First question on gamedev! Hopefully its a reasonable one (though I know the topic has been beaten to death... I just couldn't find an answer specific to my problem). That must mean I'm approaching it all wrong! XD gamedev.stackexchange.com/questions/23173/…
 
3:06 AM
@tylerrrr07, You should post the link as a separate chat line. Gives a nice parsed visual thingy ma dingy.
 
Won't let me update the old question to remove it so...
0
Q: How can I determine which direction a 2D collision is occurring from?

tylerrrr07The problem is as follows: Think 2D Zelda (Links Awakening, A Link to the Past) style movement where you can run into walls from any of the four cardinal directions, or basically up, down, left, and right. The difference between my movement and these games is I want to allow for diagonal movemen...

 
<3
 
Answer my question dude! :D
I feel so noob asking it too lol
 
Basic AABB collision. :P
I'm not good at answering questions.
Except when it comes to triangles.
I'm the guru of triangles. quote gamedev.stackexchange
 
Lol... triangles indeed. Had I known that term I probably would have been better at researching it myself
 
3:11 AM
Axis Aligned Bounding Boxes
 
makes soooo much sense now!
the term i mean
 
Hmm... My collision system is pretty specific to my tile engine.
 
I'm not using tiles :/
 
Yeah, exactly.
The idea behind mine would work for you, only instead of checking for tiles, you'll be checking for objects nearby.
 
could work!
and really it doesn't matter the context of whats near... its once I know what I'm colliding with how do I deal with it
 
3:15 AM
But again, my system is very specific to my tile system.
The tile collision stuff starts at line 136: pastebin.com/XDEE1dgB
 
omg readable code :D
 
It gets possible collisions based on current movement direction.
 
all the examples I find out there regarding "Game Dev" are such garbage variable names imo
 
Heh, my variable names are pretty verbose since that's what C# encourages and it's what I like too.
Anyways, what I'm doing is checking what way we're moving, and then using the delta position to find possible tiles to hit.
You'd use the delta position to check which objects you'll be colliding with next frame.
 
Yeah I've got that
I collide properly
my problem comes in with diagonal movement
if I have a horizontal wall and I'm moving Up-Left I want to continue moving left
 
3:19 AM
Ah
Fix velocity instead of position.
You set the velocity to the exact value that would cause it to touch the wall next step
 
I don't understand how that helps?
oh maybe...
ahhhhhhhhhhhh
I need to individually check what will happen after each cardinal direction not what would happen after it moved entirely
 
Exactly
 
Go post something to that regard
so I can vote up and mark as answer :P
i was about to code and got confused again...
oh I've got it again
I think...
 
Check lines 172 and 188 in my pastebin.
You can see how I check collision first in one axis and then in the other axis.
You understand?
 
I do. Just not implementing it right yet
hrmmm
ah
ok
Sweet. Got it I think. Needs a little refactoring as I went through the wall when I hit a corner but otherwise I got it.
3 rep! Woot!
Bahaha.... Double checked my level... I went through the corner because there was a gap in my collision box
 
3:52 AM
That's my favorite kind of bug.
 
Hehe
 
It was actually a glitch with the level editor providing negative values for width / height and I handled it by setting the widths / heights via absolute value
this then flipped them in the wrong direction leaving gaps
Editor needs fixing
 
"It's misbehaving because the level data is wrong" is always very reassuring. Also, often you can fob those bugs off to designers. ;)
 
Except he might've designed the editor himself. :P
 
Nah... using the new version of Gleed2D which was actually a complete rewrite by someone else. Despite the bugs this version is already much better so I'm using it and reporting bugs I find
This prototype level I put together is working exactly as expected. Now I need to prototype interacting with objects in the level
Then I need to write production quality code... and then I'm probably ready to start writing stuff specific to my game
:D
 
3:59 AM
"Bug #7 Summary: The editor sucks. Component: Editor. Bug reproduction steps: 1. Launch editor. 2. Notice that editor sucks. Expected behaviour: Editor shouldn't suck."
5
 
@TrevorPowell lol
 
@TrevorPowell Got mad my MySQL and did that. They were not amused.
 
Any thoughts on how many objects I should be checking for collisions against before I need to implement a grid or some other sort of higher level check?
I don't anticipate too many things to check against on the screen (Bounding boxes for the area, a few items scattered throughout the area that I can't pass thorugh, a few npcs, and a handful of things that could be interacted with)
Then I figure unload the screen and load a new screen for other rooms
 
@tylerrrr07 Implementing a grid or other higher level check is an optimisation. Don't implement optimisations.
 
@TrevorPowell So don't worry about it until I notice that I need to worry about it?
 
4:05 AM
The first rule of program optimisation is don't. :)
4
 
@TrevorPowell but... but... optimizing things is great fun
 
Right. And when you notice that you need to worry about performance, you need to profile your code, and work on speeding up the parts that are spotted by the profiling.
 
Makes sense!
 
but then I don't write games I make libs and tool for others to use
so I get to optimize everything :)
 
Tools development is fun
 
4:07 AM
If you're coding for fun, then optimising is fine. As long as you recognise that it's not an efficient use of your time, with respect to actually finishing a product. :)
 
I love the tip.
 
In C# is there anyway to take in a type and enforce that it is a certain type of object or one of its children?
 
Define "take in"
 
check - if (ObjectInstance is ObjectType) ?
 
Such as publiv void SetState(State or any derived typs inheriting from the state base class)
 
4:10 AM
thats automatic in C#
 
I want it to be IDE enforced if possible
how so?
 
public void SetState(State state)
 
That's just basic polymorphism. :)
 
State and all classes inheriting from State would be accepted
 
I want on object of type type not an instance of the class
 
4:11 AM
(I completely flubbed a job interview question about polymorphism, a month ago. Felt so silly.)
 
Can I ask what the question was more specifically?
 
"define polymorphism"
 
XD
@ClassicThunder could you explain why you might want that?
 
user4704
4:14 AM
Anybody going to GDC?
 
Opposite side of the planet. :(
 
user4704
Pff get work to pay for it.
 
@JoshPetrie too expensive :(
 
user4704
Apparently that's what I did.
 
user4704
(this is news to me, which is why I'm only asking about it now)
 
4:15 AM
I've had work pay for it in the past. Not this year.
Expensive from this far away, though.
 
user4704
I've never been, and don't really understand the point. But if it's on my expense account then why not. :D
 
@tylerrrr07 I'm making a farseer contraption builder that steps though states depending on input and I want the statemaching to be extandable and have a clean API
 
Plane fare costs more than the tickets, from here.
Josh: The point, from your perspective, is to meet as many people as possible, and stay in contact with them! Best thing ever from a career perspective. Do you have business cards?
 
@ClassicThunder but what are you going to do with the type object? Why a type and not an object instance? or an Enum?
 
user4704
@TrevorPowell Yea, I do.
 
4:19 AM
("stay in contact with" means that you send them an e-mail within a week after the conference ends, and then follow up with occasional pleasantries and how things are going for you at your current job approximately every three to six months. I actually put that on my calendar as a repeating 'to-do' item so that I don't forget.)
 
user4704
Pff I hate people.
 
user4704
:D
 
True of lots of people in this industry, I've noticed! ;)
 
Nate Petrie is much nicer
Though he swears a lot.
 
@tylerrrr07 I'm going to use it in the transition tree and to fetch the states out of the factory since only 1 should exist at a time
 
4:21 AM
Was it Nate?
Nale?
Hmmm.
 
user4704
I swear frequently
 
Every job I've had in the last fifteen years, I've gotten because I already knew someone at the company. Makes a huge difference. :)
<-- doesn't interview well.
 
user4704
I took my team out drinking last weekend and they mostly discussed how I am grumpy and swear a lot.
 
user4704
Just like my brother: youtube.com/watch?v=2B9_-vVRF8U
 
@ClassicThunder I still don't fully understand... for the moment the best I can think of is throwing an exception if the passed in type isn't the type you want... thinking a little more...
 
user4704
4:25 AM
Having an object that represents a type is useful for reflection -- what methods does this type have, what data, et cetera.
 
I do that in C++. Well, not methods, but certainly data.
 
Yeah its the Type as a parameter I don't get
 
user4704
How else do you pass it around?
 
Valid point
how do you enforce which types can be passed?
which is @ClassicThunder's original question
 
I know I could do it with my C++ implementation, since my type objects have the same hierarchy as the classes they're referring to. No idea with C#.
 
user4704
4:38 AM
You could check the type to see what its parent is, or what interfaces it provides
 
user4704
Or you should just make the code operate appropriately on any type
 
Thats what I was saying... you could check once inside the function that you have the right type but I don't know that you can define the method to only take certain accept certain types as parameters
I think the parameter must be type Type
 
user4704
You can't (in C# and such). You shouldn't need to.
 
So now you see why I don't understand :)
 
user4704
Well I missed the start of the discussion anyhow
 
4:50 AM
I have a state machine and I don't want to use the constructor when I call SetState because the state needs metadata that is added inside the SetState function
It also causes the user in their extension of class to have to save variables in the constructor for a later safe(has the metadata) initialization
 
I pre-create states. "SetState" just passes a pointer. Or better, an enum value.
 
I can compile the states at run time so no enum
 
5:08 AM
I know its pretty much impossible to tell with what I'm about to say... but I'm noticing a very slight stutter roughly every 1-2 seconds... Garbage Collection?
 
xbox 360?
 
best guess?
PC but XNA yes
 
probably
 
its very slight
 
user4704
It's pretty easy to check.
 
5:10 AM
ooo
 
user4704
Run perfmon.exe and enable the GC counters.
 
how so?
 
user4704
Or use a profiler like the ANTS profiler from Redgate (which has a free demo and is excellent)
 
Its bad problem with the 360 but the PC can have problems if you're allocating a lot of memory
 
Garbage collection makes me sad.
But I'm a grumpy old coder who remembers the good/bad old days. ;)
 
5:12 AM
Garbage collections usually faster than doing yourself from everything I read
 
Depends on what you're measuring. :)
 
time it takes the code to execute?
 
I like to measure by the number of hours it takes to debug why a block is leaking. :)
 
user4704
If you know what you are doing, you can achieve excellent performance in either case. If you don't, you can pretty easily screw it up. GC is not a cure-all, nor is "manual memory management."
 
And wow, I'm using an awful lot of emoticons today. Really ought to cut back.
 
user4704
5:15 AM
Most people who wildly advocate for one or the other being trivially and obviously superior probably hasn't spend that much time working in the bowels of either class of code.
 
user4704
C++'s approach for example has this obnoxious tendency to be viewed as "close to the machine" (despite being a clear abstraction and spelled out explicitly as such in the standard), which makes people do dumb things.
 
Josh, this is the Internet. You're not supposed to have a nuanced point of view on these things. It's all black or white, and everyone in the opposing camp is an idiot who deserves scorn and ridicule.
 
@JoshPetrie Best thing to do is avoid creating anything significant during the game loop
 
user4704
C#'s approach has a similar tendency to be interpreted as "doing it for you," which makes people do dumb things.
 
I killed perfmon... gonna look into ANTS XD
 
5:16 AM
@TrevorPowell "What makes a good man go neutral? Lust for gold? Power? Or were you just born with a heart full of neutrality" :)
 
user4704
@TrevorPowell My camp is smack in the middle, this why I can apply scorn, derision and ridicule to the maximum amount of people.
 
user4704
:D
 
Fifteen years in the industry. FIFTEEN. How has that never occurred to me in all that time?
 
user4704
I had an excellent (and extremely cynical) mentor.
 
user4704
5:18 AM
@tylerrrr07 ANTS is invasive and so will change the behavior of your application, which may make your stutter go away.
 
user4704
It's still excellent, just be aware of that. perfmon.exe uses system collectors.
 
All the best mentors are extremely cynical.
(Actually, not fifteen. It'd be fifteen in April. And I'm at least temporarily leaving the industry in February. So close, and yet so far. ;) )
 
holy cow this tool is amazing
 
user4704
I am too bad at math to figure out how long I've been doing this. And there was that stint in the DoD for a few years too that maybe doesn't so much count.
 
user4704
I'm only 29 though, so it's not nearly 15 :D
 
user4704
5:25 AM
This question is a disaster.
 
user4704
0
Q: linker error undefined reference in Base::Class_object FREEGLUT

AceI have this code /////////////////////////////////////Gnome.cpp file #include "Living.h" class Gnome:public Living{ private: public: Gnome(); void drawObjects(); }; Gnome::Gnome() { spriteImg = new Sprite("graphics/gnome.bmp"); //<-------------this is where it says there is the ...

 
oh well i'm off to bed
later guys
 
ciao
 
user4704
Not sure if I should edit it to clean up the code or just close it as off-topic / too localized.
 
so interesting item of note... I'm pretty sure performance improved but the numbers for the method I improved got larger
maybe I should figure out what things like "Time%" and "time With Children %" and "Hit Count" mean
 
user4704
5:28 AM
Hit count is how many times it was called.
 
ah
thought as much
 
user4704
Time% is the percentage time spent in the function, time-with-children is the time including child calls
 
so I ran the profiler about half as long but the time and time with children are significantly larger
either way this tool is awesome
thanks for the tip
I'll narrow down the troubles no problem
this is probably a purchase for me :D
maybe
$500 is a little steep
$800 for the full deal
 
user4704
Yea, it's not cheap for a single developer unfortunately.
 
Curses, Josh, you edited too quickly for me!
 
user4704
5:33 AM
But their memory profiler rocks too. I use them both at work.
 
user4704
:D
 
user4704
I mostly nuked it, which is a bit cheating since I knew what the relevant bits are.
 
user4704
fff circuit breaker tripped
 
I was just clicking on the 'submit' button as the "edited" banner came up.
 
I think the key is to get all of my "new Rectangle()" calls out of my draw call XD
thats what I get for fast prototyping without a care in the world
 
user4704
5:36 AM
So, Rectangle is a value type and is not likely to generate a collection.
 
user4704
Assuming we're talking the XNA Rectangle or whatnot and not something you wrote.
 
user4704
Because, unless you do something unusual with it like box it or store it to a reference type, it will be on the method's stack.
 
herrmmm
are foreach loops dangerous as far as object creation goes? I would suspect it just references the object inside the collection
 
user4704
Depends, you might have stimulated the creation of an enumerator
 
no clue... working with the objects provided by this level editor
hmm
 
user4704
5:41 AM
Then it's a fair bet.
 
I'm looping, getting a layer, looping through that, getting an item, casting item properties as a specific type of properties, then drawing the item based on the properties
 
user4704
I'm off.
 
ciao
thanks for the tips
 
Seeya, Josh!
 
5:44 AM
I wonder if this "stutter" is just an optical illusion... damn eyes
 
@JohnMcDonald AO?
 
@tylerrrr07 http://web.mit.edu/persci/people/adelson/checkershadow_illusion.html
 
@Gajet Asteroid Outpost (AO)
 
I've played it a couple of times.
 
Oh cool, so I guess no news is good news when it comes to bugs
 
5:59 AM
I didn't really encounter any bug,
though I had rough time figuring out power mechanism.
 
Oh yeah... that's one of the reasons I'm working on that tutorial, and I also plan to require that buildings are connected to the grid in order to be built
the tutorial is a must though, I just get bored when I work on that, lol
 
I'm still not sure when do I run out of power
I just kept adding more and more stuff, till I saw nothing was build.
 
Ah, yeah... I can see how it's not obvious, and there are ways to screw yourself with the current model
 
they I started building power stations. and everything came back to normal.
 
Solar Stations produce power at a given rate based on their level and can hold a maximum amount of power in their power reserve
 
6:08 AM
I just played a game at kongregate.com which I think has many similarities to yours
 
If they are dry, they will still be producing power at their normal rate, but anyone who wants power will be either succeed and drain the last drops of power OR be denied power and not be able to do anything
 
I'm looking for it now. you can use their ideas I guess
 
@Gajet heh, I wonder why? **looks away**
heh, it's because I'm cloning that game
at least for a starting point
The Space Game?
 
it was somehow on a planet were you have to provide power to some stations and scape
 
Well, here's the one I'm cloning and enhancing: kongregate.com/games/CasualCollective/the-space-game
I have a number of enhancements in mind, but the first of which is coop
 
6:12 AM
it seems I was talking about "creeper world"
it was on their suggestions
by the way I was thinking 20000 lines of code is a bit too much for such a project, don't you think so?
 
hahah
I donno, that's how many it is. That does include the testing projects, so not just the core code that is required to execute the game
 
well I think if I was going to develop such a game, I would use a gameengine + 5000lines max
 
well, the "engine" in this case is XNA, so maybe that counts for some of it?
3276 lines are for the QuadTree and testing projects
 
is there really a need for them?
knowing that there is a spitebatch class in XNA that almost do everything you need for a 2d game
 
A need for the Quad Tree?
No, there's no need for the quad tree at this stage of development. The only reason it's there is because a friend of mine wanted to work on one for his game, so I said "Sure, let's make a quad tree"
 
6:18 AM
:D
that's how I develop stuff too, except with a they ask me to work on their project!
 
and a need for the 832 line of code in the Primitives2D package that I think I only use for the lasers? no need, it's just easier and there was a development need to be able to easily draw lines and such
So yeah, even without those two packages, it's still 18754 lines for just the core game code, the sprite animation (not including the program to make them), and the UI code
bah, let me remove all testing code from that
anyway, I'm tired, and yes, it takes quite a lot of code to produce something like that.. at least the way I did it
 
I guess I'm not all that easy with you way
my codes are almost always way too compressed.
 
:/ yeah, mine is usually expanded
and I always have curly braces
It's just a thing I do
anyway, I'm off to bed
 
6:39 AM
0
Q: off topic flags could point to sites Other than meta

Gajetwell today we had a question really suited for Stack over flow in gamedev. But when I tried to flag it I could only suggest it belongs to meta site. I guess we add Other related sites to that list, like SOF, programmers, or maybe mathematics. side note: I just asked on meta.stackoverflow to add ...

 
6:53 AM
@Gajet bah, couldn't sleep without doing this first. Here's a summary of all of the files in AO: docs.google.com/spreadsheet/…
Selecting areas will calculate a sum in the bottom right
 
 
1 hour later…
8:10 AM
I'm at about 90,000 lines of code for my game, at the moment, apparently.
(That's only counting source files, not headers)
 
8:58 AM
the largest code I can remember I've ever developed was an OCR project which was about 10,000 lines. the next one is a wrapper for SDL to easily use it's pixel manipulating features which was 1000 lines source + 150 lines header
 
 
2 hours later…
10:40 AM
My 90,000 includes the game engine I wrote. About half of those lines are in the engine.
 
11:26 AM
@MindWorX I've found a bug, but I couldn't create an screenshot!
don't know why but after trying to take an screen shot it was just a gray screen!
anyway, it seems there is a problem with 'm' shortcut. I was looking for a way to return to the main menu (apparently there is no such a thing), and then I discovered there are short cuts for construction options.
each time I pressed 'm' helper circles were somehow attacked to the screen, though the main miner thing wasn,'t placed.
 
 
3 hours later…
2:20 PM
@Gajet Huh? Did you mean @JohnMcDonald?
 
2:32 PM
hmmm, i used to keep track of how many lines total my code was
but there's no easy tool to count them in my editor, so i just don't care enough
though a quick round of google searching found me this: locmetrics.com
which says i have 13k lines of code
and 73 source files
 
9,397 here. :P
 
I'm just getting started. I'm sure I'm less than 500 hehe
 
I'm contemplating how to handle enemies/npcs vs players codewise.
I mean, a player has a bunch of things npcs/enemies normally don't need.
 
ah so you mean like an inheritance structure
 
Yeah.
 
2:40 PM
i'd say about 3-4k of that for me is xmlparser libraries, and base64 conversion libraries
 
I don't have good advice... but I can tell you that the way UDK / UnrealScript does it is that the player and the enemies share components. For example they both have a "Pawn" which is the physical representation in the game
 
I'm thinking of making the "player" aspect sort of a wrapper around the npc/enemy class.
 
so we'll go with 10,000 lines of code of my own stuff
i would also go with a base "character" class which the npcs and enemies and the player inherit from
 
Yeah, it's a good idea to make an entity indifferent to who's controlling it by writing an interface class.
 
25808 lines of code in Legeria.
More than I would've thought.
And I still haven't readded the whole physics system back.
 
2:43 PM
hmmm, i really don't know if i'm just really good at making small programs, or if i'm missing something somewhere
 
Oh, I see where I made a mistake.
I included SlimMath
I wonder if I can make it not count that part.
Ah, more sensible, 7633 lines of code.
 
you could count how many lines SlimMath is... oh, that's a lot better. i think.
it at least makes me feel better
 
XML stuff takes a bunch.
 
2:47 PM
yeah
so much for "tiny" :P
 
The core of my system "TileWorX" takes a chunk which makes sense.
And the client is pretty focused around GameComponents, so it makes sense it takes a good chunk as well.
 
"objects" is where all the game object classes live, so it's pretty big. kind of interesting that the GUI and Engine sections take about the same in my case.
 
Indeed. :)
 
Engine is the state machine classes for everything.
like, Menu and Map... and that's about it actually (there's an Intro but it's not used)
 
I'm trying to think of a way where every npc/enemy is a potential target for the player controller, while not making AI completely complicated.
 
2:52 PM
hmm, good luck
 
Maybe something shallow for input. If the player controls, it's based on keyboard input. If the AI controls it's based on AI logic.
So the entity is coded to react to "left" and it does it's thing.
Then something on top controls when to "left"
Which would be either AI or a player.
So entities never poll for input, it's only passed to them.
 
yeah
you could have a player controller component taht can be based on inputs or AI
So in an Update() call per se, you can either check for input, or react based on AI
which isn't what you said but its what I see in my head...
 
Yeah, something like that. :)
 
You could have "Controller" -> AIController and PlayerController
all entities have a Controller
That way if you are passing messages for input, you can specifically target the PlayerControllers
 
Yes! And Controller has events, like BeginMoveLeft, EndMoveLeft and so on.
 
2:56 PM
You got it
 
So all my entities have a Controller member, which exposes all types of input possible, and it's up to the Entity how to use that input.
 
Seems logical
 
So a Goomba would need Begin/End-Move-Left/Right, and ignore Jump and other events.
 

« first day (544 days earlier)      last day (4466 days later) »