These are chat archives for lidavidm/c-heck-yeah

24th
Dec 2014
David Li
@lidavidm
Dec 24 2014 00:53
How about 4-space indent? Doesn't really matter, so long as we're consistent
I was thinking the logic to animate/control everything would be the bulk of the code
But sure, we could write a level editor as well...do you want to write GUI code in C?
Or at least, we could write our own parser for some format. TMX is rather bloated for our needs
Tyler Etzel
@tyleretzel
Dec 24 2014 00:59
i dont really care about the indent; im just joking with you :smile:
just decide on something and tell me
David Li
@lidavidm
Dec 24 2014 00:59
Using something like http://www.devlinslab.com/2007/11/simple-tile-map-editor.html might be interesting
We could then write a parser for the binary format
Tyler Etzel
@tyleretzel
Dec 24 2014 00:59
I dont know if we need to write a full fledged gui and stuff
David Li
@lidavidm
Dec 24 2014 00:59
That is windows-only though
Oh
Tyler Etzel
@tyleretzel
Dec 24 2014 00:59
we could just do a keybind interface
David Li
@lidavidm
Dec 24 2014 00:59
That seems kinda clunky
Tyler Etzel
@tyleretzel
Dec 24 2014 01:00
eh. it doesnt need to be intuitive to anyone but us
David Li
@lidavidm
Dec 24 2014 01:00
Yeah, I'd just rather focus on getting the game itself up and running
Tyler Etzel
@tyleretzel
Dec 24 2014 01:01
true. I mean, we can always make something that is dead simple, and then improve it
personally, i would find it fun to make a level editor. If something seems easy enough though, we can go for it
David Li
@lidavidm
Dec 24 2014 01:03
Well if you want to work on a level editor go ahead
Maybe we should first define a format, so we can write a test map by hand
That way I can get something rendered
And let's just do 4-space indents
Tyler Etzel
@tyleretzel
Dec 24 2014 01:06
ok that sounds fair
so what kind of format should we define?
David Li
@lidavidm
Dec 24 2014 01:08
Basically we need the format to specify width, height, tileset image, tile width, tile height, what each tile is, and optionally collision boxes
So text, binary, whatever, so long as it works
Tyler Etzel
@tyleretzel
Dec 24 2014 01:11
hm. this is somewhat tricky actually
David Li
@lidavidm
Dec 24 2014 01:12
:+1:
Tyler Etzel
@tyleretzel
Dec 24 2014 01:12
particularly with collision boxes, unless we want to be really boring
David Li
@lidavidm
Dec 24 2014 01:12
well collision boxes should only be rectangles and line segments
and maybe circles
Tyler Etzel
@tyleretzel
Dec 24 2014 01:12
where should line segments come into play?
David Li
@lidavidm
Dec 24 2014 01:12
Ramp
Tyler Etzel
@tyleretzel
Dec 24 2014 01:13
hm
David Li
@lidavidm
Dec 24 2014 01:13
Chipmunk only supports segments, circles, and polygons in any case
And presumably it's optimized for rectangles (AABBs, axis-aligned bounding boxes)
Tyler Etzel
@tyleretzel
Dec 24 2014 01:14
so what is the optimal way to create a static polygon in chipmunk? with 3 segments or a polygon
*static triangle
David Li
@lidavidm
Dec 24 2014 01:15
We'll have to benchmark and see
But presumably for a triangle polygon is faster
Tyler Etzel
@tyleretzel
Dec 24 2014 01:16
are we planning on using a strict tileset?
nevermind, you said tileset image
David Li
@lidavidm
Dec 24 2014 01:16
Yeah, the tileset would be divided into a grid
Tyler Etzel
@tyleretzel
Dec 24 2014 01:18
if we have a finite set of collision boxes it should be pretty trivial to make a data format
David Li
@lidavidm
Dec 24 2014 01:18
Yeah, writing the editor would probably take more time
Tyler Etzel
@tyleretzel
Dec 24 2014 01:18
im just worried weird things might happen if we represent the ground as a bunch of small boxes
with respect to physics that is
David Li
@lidavidm
Dec 24 2014 01:18
Shouldn't the ground just be one large box?
Or are we marking certain tiles as "ground" tiles
Tyler Etzel
@tyleretzel
Dec 24 2014 01:18
so basically one polygon?
David Li
@lidavidm
Dec 24 2014 01:19
I thought we would manually place collision boxes
Tyler Etzel
@tyleretzel
Dec 24 2014 01:19
oh. hm.
well the ideal case would be to not even do the whole tile stuff at all and instead just allow arbitrarily shaped terrain
which is totally possible and not too much more work if we build our own editor. that just makes things hard graphically
Tyler Etzel
@tyleretzel
Dec 24 2014 01:26
i think we have to reperesent the ground as many different shapes (in chipmunk) anyways actually
how would this work: we have a tileset, and then each tile has a corresponding collision box
that should be fine, as long as we make the collision boxes and sprites perfectly consistent with the tile width and height
David Li
@lidavidm
Dec 24 2014 01:40
Yup, that would mean creating a lot of bodies in chipmunk though
Unless we had some algorithm that merged adjacent bodies on the same y-level or something
Tyler Etzel
@tyleretzel
Dec 24 2014 01:43
i dunno having one big body might create some funky physics effects
David Li
@lidavidm
Dec 24 2014 01:43
Can't we mark bodies as static?
And how so?
Tyler Etzel
@tyleretzel
Dec 24 2014 01:43
yeah; just attach a space to the worlds static body and it wont move
so basically im speculating
David Li
@lidavidm
Dec 24 2014 01:43
I mean, best performance is fewest bodies
Tyler Etzel
@tyleretzel
Dec 24 2014 01:45
what about changing the properties of parts of the ground as a game mechanic?
David Li
@lidavidm
Dec 24 2014 01:45
o.o
Wait, just to be clear
It's going to be vaguely like early Mario
With square tiles only
No weird terrain like in Limbo/etc
Tyler Etzel
@tyleretzel
Dec 24 2014 01:46
sure; but why even have a physics engine if we arent going to do cool shit like make bouncy terrain!
David Li
@lidavidm
Dec 24 2014 01:46
Alright
So we're moving physics for the terrain out of the entity system then?
Or actually, if we're modding their properties then they each need to be entitie
So we just might have to bump the limit up
Tyler Etzel
@tyleretzel
Dec 24 2014 01:47
yeah i was thinking to just keep them as entities
David Li
@lidavidm
Dec 24 2014 01:47
so. portal gels anyone?
alright that works. i'll summarize in design.md
Tyler Etzel
@tyleretzel
Dec 24 2014 01:48
implementing gels would be really hard
David Li
@lidavidm
Dec 24 2014 01:48
Also, how are we going to define the collision boxes for each tile?
Well if we're going to do something like "make terrain bouncy" i was just saying that sounds like the blue gel from portal
Tyler Etzel
@tyleretzel
Dec 24 2014 01:49
i suppose that would be done manually
David Li
@lidavidm
Dec 24 2014 01:49
But how/where?
Like, we have a text file specifying the points of the polygon for each tile?
Tyler Etzel
@tyleretzel
Dec 24 2014 01:50
thats what i was thinking
David Li
@lidavidm
Dec 24 2014 01:50
Okay just making sure
Tyler Etzel
@tyleretzel
Dec 24 2014 01:50
whats the best way to deal with a tile set>
is it just going to be a single jpg image?
David Li
@lidavidm
Dec 24 2014 01:51
Mm, should just be a single PNG grid of tiles
Each tile has to be the same size
Tyler Etzel
@tyleretzel
Dec 24 2014 01:51
ok. Does SDL provide an easy way to cut that up into pieces?
David Li
@lidavidm
Dec 24 2014 01:51
And the tiles can be numbered left-to-right, top-to-bottom
Yes
SDL lets you render only a certain rectangle from a texture
Tyler Etzel
@tyleretzel
Dec 24 2014 01:51
cool
Tyler Etzel
@tyleretzel
Dec 24 2014 02:06
whats michael up to?
David Li
@lidavidm
Dec 24 2014 02:06
Trying to get everything working xD and learning C
Tyler Etzel
@tyleretzel
Dec 24 2014 02:06
ah yes.. has he installed linux?
David Li
@lidavidm
Dec 24 2014 02:06
Nope
He got Code::Blocks
Tyler Etzel
@tyleretzel
Dec 24 2014 02:51
should i add to the build file so that he can build it on windows?
or add his own specs
David Li
@lidavidm
Dec 24 2014 02:51
I think he's going to figure that out
Tyler Etzel
@tyleretzel
Dec 24 2014 02:52
ok
also: I think the best way to do the map editor is just to build off of the rendering system we already have in place. Do you suggest that it should be a different executable, or just a mode within the game itself?
David Li
@lidavidm
Dec 24 2014 02:53
Let's have them share rendering/loading code at least
I guess we could build it as a separate mode
Doesn't really matter
Tyler Etzel
@tyleretzel
Dec 24 2014 02:54
hmm
Tyler Etzel
@tyleretzel
Dec 24 2014 03:24
will a level be a directory?
David Li
@lidavidm
Dec 24 2014 03:25
What do you mean?
Like, a folder per level?
Could work
Tyler Etzel
@tyleretzel
Dec 24 2014 03:25
yeah
hopefully we dont run into file system problems with windows
David Li
@lidavidm
Dec 24 2014 03:26
So, each folder contains the level data, tileset, and tile collision data?
Screw windows
Tyler Etzel
@tyleretzel
Dec 24 2014 03:26
that is logically equivalent to "Screw Michael" thogh
and yes: we have to have multiple files for a single level, so it makes sense to put them in a folder, correct?
David Li
@lidavidm
Dec 24 2014 03:27
Could zip them up too :P though that's more effort
As long as we avoid case sensitivity stuff and don't use weird characters we should be fine
Tyler Etzel
@tyleretzel
Dec 24 2014 03:28
fine for windows compatibility you mean?
David Li
@lidavidm
Dec 24 2014 03:28
Yeah
Tyler Etzel
@tyleretzel
Dec 24 2014 03:30
we should be able to use just stdio right?
David Li
@lidavidm
Dec 24 2014 03:30
Yeah
It's cross platform right?
We should use unix newlines only though
Screw \r\n
Tyler Etzel
@tyleretzel
Dec 24 2014 03:33
yeah michael will have to deal with that
Tyler Etzel
@tyleretzel
Dec 24 2014 04:01
i didnt see that you already had some level state stuff in screens
David Li
@lidavidm
Dec 24 2014 04:01
Oh oops
Yeah
Tyler Etzel
@tyleretzel
Dec 24 2014 04:01
would you prefer that to stay there, or have levels.h/c exist?
David Li
@lidavidm
Dec 24 2014 04:01
I just got Michael animated too
Doesn't matter
Let me push my work, one sec
Tyler Etzel
@tyleretzel
Dec 24 2014 04:02
im not really sure. modularity in C is hard
David Li
@lidavidm
Dec 24 2014 04:02
Yeah :/
For now let's keep them together
We can split if needed later
Tyler Etzel
@tyleretzel
Dec 24 2014 04:02
ok
David Li
@lidavidm
Dec 24 2014 04:03
Could have a screen_defines.h, screen_level.h, and a screens.h that includes the previous two together
Tyler Etzel
@tyleretzel
Dec 24 2014 04:03
should the Level struct in levels vecome screens then?
or be moved to screens.c
David Li
@lidavidm
Dec 24 2014 04:03
Oh is "level" a tilemap?
That can stay separate
Why is there another position struct though?
The level screen is a game state in the state machine
Tyler Etzel
@tyleretzel
Dec 24 2014 04:06
it is to define the collision boxes
as a set of points, that is
David Li
@lidavidm
Dec 24 2014 04:06
ah okay
Tyler Etzel
@tyleretzel
Dec 24 2014 04:07
perhaps I should rename level then: something tile related sounds more intuitive
David Li
@lidavidm
Dec 24 2014 04:07
BBPoint
BBoxPoint
Tyler Etzel
@tyleretzel
Dec 24 2014 04:08
huh?
David Li
@lidavidm
Dec 24 2014 04:09
It's a point in the bounding box right?
I guess it's not a box
so BoundingPolyPoint or something like that
unless I'm misinterpreting?
Tyler Etzel
@tyleretzel
Dec 24 2014 04:09
yeah something like that
ok so we need a tileset but we also need level data somewhere actually
levelstate doesnt do what i thought it did
we need a tileset, and then we need levels that are specified in that tilest
David Li
@lidavidm
Dec 24 2014 04:10
Err
How bout this
Tileset shouldn't really be embedded in the level
Level should point to a tileset that it uses
Then level is just a list of coordinate-tile pairs
Tyler Etzel
@tyleretzel
Dec 24 2014 04:11
that is reasonable
David Li
@lidavidm
Dec 24 2014 22:00
Ok so I pushed code making Magical Girl Mauer walk across the screen when you press left/right arrow and making her swing her sword when you press space