Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Who Needs Direction?

This thread is locked; no one can reply to it. rss feed Print
Who Needs Direction?
alethiophile
Member #9,349
December 2007
avatar

Quote:

I'm considering handling items outside the tilemap, so items doesn't have to be aligned with the map grid.

The only way I've ever handled items in a game, it works by having an obj_map[][] that contains the object map in the grid, that's used to find things, but you can put the objects wherever and obj_map is automatically updated when it moves.

--
Do not meddle in the affairs of dragons, for you are crunchy and taste good with ketchup.
C++: An octopus made by nailing extra legs onto a dog.
I am the Lightning-Struck Penguin of Doom.

23yrold3yrold
Member #1,134
March 2001
avatar

Quote:

You're the leader... ;)

Yes, and? I go to my team leader when I need something all the the time; if something is a hindrance to production I want to know about it. :P

Quote:

Don't stare too long, it gets crappier the longer you look at it :P

Actually that's really nice! Original art by you? Good job. The ground texture and the grass are excellent imo, the striped plants are good, I wasn't really picturing any water in this area but it doesn't look bad. The buildings look more like rock than metal and a bit beat up but even as it is it's pretty close or better to what I pictured the overworld as being like. Just need to worry about rocky tiles now, the colony tiles can wait a bit until we figure out how they're going to look, unless you want to take a stab at designing that too.

I didn't even know Allegro 5 was usable yet ...

Quote:

How precise collision? Fill in that ? with what we need.

Tilemap collision will be strictly binary so far; the settings we have in mind imply a lot of right angles and I don't see much need for sloped tiles. If someone wants to implement them I'll use them but not real necessary. And yeah, draw bottom-to-top, no need for a z-buffer.

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

OnlineCop
Member #7,919
October 2006
avatar

23yrold3yrold said:

And yeah, draw top-to-bottom, no need for a z-buffer.

Um... top-to-bottom or bottom-to-top?

23yrold3yrold
Member #1,134
March 2001
avatar

Sorry; more noobness on my part. :) Wasn't thinking.

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Trezker
Member #1,739
December 2001
avatar

I suggest using bounding rectangle collision.

Maybe bool Collision(Rect brect, Vector velocity, Vector &adjust);

Then the function could provide an adjustment vector that would move the brect onto free ground.

bamccaig
Member #7,536
July 2006
avatar

23yrold3yrold said:

Yes, and? I go to my team leader when I need something all the the time; if something is a hindrance to production I want to know about it. :P

You've basically told us to git'r'dun without documenting what 'r is. :P Where's the leadership? You should be telling people what they're doing, IMO. And you can't do that until you know what needs to be done and what people are capable of. That's my opinion anyway. I'm not just gonna start adding code to the repository unless asked to do something because it probably won't fit into what the others are working on. I suspect there are others among us that feel the same, but maybe I'm wrong.

:-/

OnlineCop
Member #7,919
October 2006
avatar

23yrold3yrold said:

Tilemap collision will be strictly binary so far; the settings we have in mind imply a lot of right angles...

So are we saying that we're doing more of a free-flowing movement style, or a "I'm on this tile, I want to go down to THAT tile..." approach?

If we did the tile-to-tile movement, we really don't need much in the way of collision detection for player movement. "if (is_occupied(map[...]) {...}"

But if we do more of a free-flowing movement (especially for shooting things with the mouse), it would be more "if (is_in_line_of_fire(object[...]) {...}"

23yrold3yrold
Member #1,134
March 2001
avatar

Quote:

You've basically told us to git'r'dun without documenting what 'r is. :P Where's the leadership? You should be telling people what they're doing, IMO.

I have been telling people what to do and "git'r'dun". If something is getting in the way of that, the leader needs to know. This is a two-way street here. :) I agree the programming team doesn't have all the details yet but if they need to know something in particular they need to ask. Right now they have enough to start and if they're waiting on me for something in particular, I need to know it so I can keep them informed.

Quote:

So are we saying that we're doing more of a free-flowing movement style, or a "I'm on this tile, I want to go down to THAT tile..." approach?

Free-flowing, like the typical Zelda games. This is an action game; movement is pixel-based, not tile-based.

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Trezker
Member #1,739
December 2001
avatar

Hmm, line of fire might be needed too with these high tech weapons and all. Good call there.

Well, I'm imagining characters moving freely and have a bit smaller bounding box than tiles. So when going through a one tile thin alley you can still jiggle a little. And maybe we could have "monsters" that are too big to go pass through some places, or just a fat NPC.

23yrold3yrold
Member #1,134
March 2001
avatar

Yes, you'll have to worry about line of fire especially if we're shooting with the mouse. :) Lots of funny angles to fire at ...

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

bamccaig
Member #7,536
July 2006
avatar

Vanneto
Member #8,643
May 2007

I second that question.

In capitalist America bank robs you.

Trezker
Member #1,739
December 2001
avatar

I as lead programmer is being lazy.. But I have done some stuff and is thinking of what to do next and who to delegate stuff to.

Maybe time for some nominations.

OnlineCop for tilemap coding?

bamccaig, are you capable of making an item manager?

bamccaig
Member #7,536
July 2006
avatar

That depends on what an item manager is in this context. :) I'm going to assume I can probably figure it out, but I'm going to need some details to do so. :-X

Trezker
Member #1,739
December 2001
avatar

The item manager manages Items that are on the ground.
A little info was posted here: http://www.allegro.cc/forums/thread/597566/770566#target

Basically you can add items at given locations and pick stuff up.
The Item class itself hasn't been designed clearly yet, but from the managers point of view it just needs a few functions I think.
Item::Render()
Vector Item::Get_position();
Item::Set_position(Vector position);

I don't think it needs to interact with the map, just assume things can be put where it's asked.

bamccaig
Member #7,536
July 2006
avatar

decepto
Member #7,102
April 2006
avatar

Will somebody please think of the children!

--------------------------------------------------
Boom!

Trezker
Member #1,739
December 2001
avatar

Right, the children. Their bounding rect should be so small they can pass by each other in a one tile wide passage. :)

OnlineCop
Member #7,919
October 2006
avatar

What all do we need to implement tilemap coding?

Map:

  • layers (std::vector to include # of layers and actual pointer TO the layers)

  • # of tiles high and wide

  • layer identity (0 = normal tiles, 1 = obstacle layer, 2 = shadow layer, etc.)

  • tile dimensions (height and width of tiles)

  • tilemap file ("tileset1.png", "tileset2.png", etc.)

  • object locations (items to pick up, NPCs, players) on the map

  • [/list]

    Does this look right? I don't want to start coding unless I'm on the right track.

    alethiophile
    Member #9,349
    December 2007
    avatar

    People were talking earlier about some line_of_fire() code? I have some vector code that could be useful. All in C, but it's there.

    --
    Do not meddle in the affairs of dragons, for you are crunchy and taste good with ketchup.
    C++: An octopus made by nailing extra legs onto a dog.
    I am the Lightning-Struck Penguin of Doom.

    OnlineCop
    Member #7,919
    October 2006
    avatar

    C is fine (it's REALLY easy to import it into a C++ file, so it's not really like there would be that much heartbreak over the code...)

    bamccaig
    Member #7,536
    July 2006
    avatar

    [bamccaig@rufus trunk]$ ./monday
    ./monday: error while loading shared libraries: liballeg-4.9.5.so: cannot open
    shared object file: No such file or directory
    [bamccaig@rufus trunk]$ 

    :'(

    ** EDIT **

    Fixed. I had to add the installation path (/usr/local/lib) to /etc/ld.so.conf and then run /sbin/ldconfig.

    Thomas Fjellstrom
    Member #476
    June 2000
    avatar

    Quote:

    Fixed. I had to add the installation path (/usr/local/lib) to /etc/ld.so.conf and then run /sbin/ldconfig.

    I usually spare myself the trouble (even if debian does include /usr/local/lib by default), and just set the install prefix to /usr for allegro.

    mkdir build; cd build; cmake -DCMAKE_INSTALL_PREFIX ..

    Or some such (I usualy use ccmake .. instead, which lets me set all of the cmake vars).

    --
    Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
    "If you can't think of a better solution, don't try to make a better solution." -- weapon_S
    "The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

    bamccaig
    Member #7,536
    July 2006
    avatar

    Anyway, I need more details before I can write said item manager... I'm still not sure what it is. Is it just going to be a container of sorts for inventory items (i.e. weapons, items) located somewhere on the map, detailing where they are so the engine can render them? :-/

    Mark Oates
    Member #1,146
    March 2001
    avatar

    Hey bam, essentially, you'll need to create a class which holds a bunch of items on the screen at whatever their coordinates. basic example:

    1class item_class
    2{
    3 int x, y;
    4 item_type item;
    5 void draw() {} // will include camera offset at some piont
    6 void update() {} // checks for player collision (all items will have the same w/h, 32 lets say
    7 void add_to_player_inventory() // will be worked out.
    8};
    9 
    10class item_manager_class
    11{
    12 vector<item_class *> items;
    13 
    14 void add(item_type i) // add an item to the list
    15 void draw() // draws all the items
    16 void update() // updates all the items, maybe includes an
    17 // item.erase() if the item gets picked up
    18 //or times out or whatever
    19};

    everything ultimately managed by item_manager.update() in the main loop

    Items could have a bouncy thing or... ya'know whatever ;) have fun be creative

    --
    Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

    AllegroFlareAllegroFlare DocsAllegroFlare GitHub



    Go to: