Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Gatleos

Pages: 1 ... 14 15 [16] 17 18 ... 243
226
They're waaaay faster to look up by array index, it's literally a single machine instruction. Associative containers have tons of stuff going on in the background.
The fastest when it comes to non-contiguous structures like linked lists, I mean.

Consider this: You have jiggabytes of available memory, but you're already short on runtime (for no evident reason). I think the tradeoff is worth it.
Yep, that's probably the best option. It just feels so wrong

PS: I still think you're doing something entirely else wrong. Have you tried counting the number of calls to floodfill(...) per tick?
I counted the calls to floodFill(), and it's always the same as the number of regions found. It couldn't be less than that, and there are no redundant calls.



EDIT: goddammit, the frame time is significantly less than 350ms when running the function, I forgot to go back to release build. It's still a slowdown, just not as much as I said. I got some ideas to speed it up anyway, though.

227
Also, the tiles are stored in an unordered_map with their axial coordinate as the key value. They must be retrieved from there (after coordinate conversion) to view their type during the flood-fill.
There you go, that's your problem. Use a 1d or 2d array, not an unordered_map. That will make your algorithm much faster. Also, as a minor optimization, coordinate conversion should run in constant time, and since it's time-critical and heavily used, make sure your coordinate conversion doesn't use any conditional statements such as ifs or ?:s.
Yeah, I know it's slow compared to a linear array. The problem is that I need to store a square map, and that won't work with a hex grid stored in a linear array. See here. There is a ton of unused space unless I use a non-contiguous storage method. And tiles are easiest/fastest to look up in an associative container.

But if that's the problem, I guess there's nothing else I can do.

228
Could you maybe describe your problem in more detail? Why, when and how often are you doing a floodfill? I need more context please. Also maybe some source. After all, you could be doing something entirely different wrong.
In practice the flood-fill would happen rarely. Right now running it every frame makes the frame time go from ~16ms (60fps) to ~350ms. I'll try to get some pseudocode that explains it, for now I'll explain it a bit more.

The algorithm loops through every tile on the map one by one. If it finds a tile which hasn't already been seen, it performs a depth-first flood-fill out from that tile. All tiles examined by the flood-fill are marked as seen, so the main loop will skip over them. So most tiles get examined twice, once by the main loop and once by the flood-fill.

Part of the slowness may be due to needing to convert between axial and cartesian coordinates for the hex grid. Also, the tiles are stored in an unordered_map with their axial coordinate as the key value. They must be retrieved from there (after coordinate conversion) to view their type during the flood-fill.

Does it have to do with the differentiation of terrain types maybe? Are you checking for simply "water" and "not water" or "water", "plains", "forest", etc?
I'm attempting to get both. That is:
  • All contiguous areas of water
  • All contiguous areas of land (terrain type doesn't matter)
  • All contiguous areas of the same terrain type
Landmasses commonly contain dozens of contiguous terrain regions.

229
Do you guys know a way to solve a connected components problem that isn't brute force? The brute force method looks like this. Basically, you loop over every single tile, skipping ones that have already been flood-filled and doing a depth-first search otherwise. The grid shown in that example is pretty small, but I'm working with a pseudo-rectangular hex grid of size 128x128. It creates a noticeable frame drop whenever I run it. Not too bad, but I want to improve it if possible.

The tiles are terrain types, all but one of them being land. The flood fill detects contiguous chunks of terrain tiles of the same type, but in addition to this I need to detect water and landmasses separately. A landmass can have many terrain type regions in it. Right now, I'm thinking of saving the coordinate of a single tile in each region, then after I detect all the regions I'll perform an A* pathfinding check between regions to tell if they're in the same landmass. Summing up the sizes of the regions gives me the landmass size.

230
Other Games / Re: Bad Box Art
« on: June 03, 2015, 03:46:22 pm »
Instead of box art, I present to you a flyer for a Japanese arcade game.

Spoiler (click to show/hide)
...Is that ram-or-possibly-owl smoking a cigarette?

231
Other Games / Re: Games you wish existed
« on: May 30, 2015, 05:39:08 am »
As for my problems with JRPG combat, I really don't think the random battles are it. I mean, they are annoying as fuck but an increasing number of JRPG devs have been realizing that and the once-ubiquitous feature is slowly dying in favor of "bump into enemy to fight" or other systems.

It's also not because it's almost always turn-based, because a fuckton of older CRPGs did that right. Rather, I think it's that JRPG combat is usually boring and barely interactive. Generally, the battles have no strategy involved and are just wars of attrition and praying to RNGsus while cool but repetitive animations play. In contrast, even the most primitive of turn-based CRPGs generally require and allow more varied tactics and allow movement around the battlefield.
This is why Twitch Plays Pokemon worked. JRPG mechanics are (usually) pure garbage, battles coming down to
Code: [Select]
while(enemies.alive()) {
if(party.healthy()) {
attack();
}
else {
castSpell(HEALING_SPELL);
}
}

They have always been a complete failure of game design, based around grinding and repetition to pad their length. I guess it could be interesting to see Glorious Nippon try to make something TES-like. Imagine an open-world RPG with character building, fully interactive environments and non-linear exploration-based gameplay, but applied to something like the Tales series.

232
Other Games / Re: Games you wish existed
« on: May 29, 2015, 04:53:39 pm »
Meaningful choices in character creation and an open world aren't all that incompatible with the kind of turn-based combat in a JRPG. I guess it depends on how you define JRPG and CRPG.

233
Other Games / Re: Games you wish existed
« on: May 29, 2015, 01:16:03 am »
Game I wish existed: A non-terrible pirate MMO that isn't Puzzle Pirates.

Literally a non-kid version of Puzzle Pirates. Is that so much to ask?
I too have dreamt of a pirate-themed MMO that wasn't made of PopCap flash games.

Though to be honest I would prefer something single-player. Like a party-based pirate RPG in the vein of Fallout/Divinity: Original Sin/Baldur's Gate/Planescape: Torment. Pirates are just my favorite thing, and I love the idea of a half-simulationist, half-gamey pirate game where you buy and furnish a ship and then sail the seas plundering and adventuring.

234
Other Games / Re: The "Recommend me a game" thread
« on: May 29, 2015, 01:02:27 am »
This isn't exactly a request for games, but I'd likely be interested in any games that have this feature.
Spoiler (click to show/hide)
Are there any games other than Morrowind that have a conversation system like this? I guess you would call it "wiki style". You'd think that by now another game would have used a system like this, maybe even improving it with topic categories and a search function, but I've never seen another game try this. Is there one out there I don't know about?
Shadowrun for SNES has a keyword convo system like Morrowind. Until someone mentions the keyword you don't know to ask about it. Unfortunately, it also clears keywords occasionally for quest reasons because you won't need them anymore, but you can go back and learn them again I think.

The earlier Elder Scrolls games have keyword systems. Daggerfall is pretty buggy depending on the build, but it and Arena are also pretty incredible in terms of the game systems they got into those early games. Arena has destructible walls for example.
I've heard a lot about that Shadowrun game, it looks kind of interesting. And yeah, I remember Daggerfall having a less-complete version of Morrowind's conversation system.

This isn't exactly a request for games, but I'd likely be interested in any games that have this feature.
Spoiler (click to show/hide)
Are there any games other than Morrowind that have a conversation system like this? I guess you would call it "wiki style". You'd think that by now another game would have used a system like this, maybe even improving it with topic categories and a search function, but I've never seen another game try this. Is there one out there I don't know about?

Albion employs a conversation system like this - keywords and/or topics. It predates Morrowind by seven years, but is awesome as hell. You can even input your own words/topics and ask NPCs about them, but they have to be context sensitive and relevant for you to get a non-generic answer.

If you don't mind older games, Albion is a great RPG. No, seriously, go get it.
Although there isn't a keyword list until the seventh game, the Ultima games post 3 all have keyword based conversations, with 4 to 6 all having you type in keywords manually.

Wizardry 8 has it as well.
How did I forget about Ultima? I'll check out some of the other games mentioned, thanks!

235
Other Games / Re: The "Recommend me a game" thread
« on: May 26, 2015, 10:48:19 pm »
This isn't exactly a request for games, but I'd likely be interested in any games that have this feature.
Spoiler (click to show/hide)
Are there any games other than Morrowind that have a conversation system like this? I guess you would call it "wiki style". You'd think that by now another game would have used a system like this, maybe even improving it with topic categories and a search function, but I've never seen another game try this. Is there one out there I don't know about?

236
Other Games / Re: Bad Box Art
« on: May 21, 2015, 03:11:19 am »
Spoiler (click to show/hide)
That cover makes the game look absolutely badass. This one on the other hand...
Spoiler (click to show/hide)
Looks like a bad acid trip. What were they even attempting to portray here?!

237
Other Games / Re: Metal Gear General
« on: May 21, 2015, 01:39:16 am »
Oh, a Metal Gear general.

They gave Raiden the snake codename in the mission in 2.  The whole point of the mission was to make him as good as the original snakes.
What? Raiden is his codename. If they had called him Snake at any point it probably would have given away the ending. Also that's kind of a spoiler, but it's like 13 years old so whatever.

It's kind of sad knowing MGSV is probably going to be the last game in the whole franchise. And funny, considering Kojima's been trying to kill the series for the last 15 years.

There are no words to describe how this thread reads to a person who's never played any of this. It's like some drug-tripping David Lynch porn festival with overtones of medieval politics.
It doesn't make any more sense if you've played them. Actually, it sort of somehow makes less sense.

238
General Discussion / Re: Mad Max: Fury Road [SPOILERS]
« on: May 21, 2015, 01:15:51 am »
Quote
This movie
I really liked it. The practical effects, use of color, cinematography and those cars were all great. The whole thing felt like one long action scene briefly interrupted by talking, but that's exactly what I was expecting anyway.
Quote
Feminism
Eh, I noticed. Didn't really care. People are too sensitive about these things.
I also love it when a film just embraces what it is, and doesn't stress out much over trying to justify or explain itself.
That was something I really liked about this movie. It's so ridiculous, yet it's all played so deadpan.

This is something that I wish more movies did. I'm just tired of movies trying to point out their own ridiculousness with constant jokes at their own expense. It's like they're so afraid the audience might think they're being serious that they have to hurry and point out that it's totally ironic, honestly. When you expend all your energy pointing out all the wackiness in the story itself, it's a bit like explaining the joke. And it leaves no space for the audience to do that on their own. People love to poke fun at things they like, and it's a bit hard to do when it's already a parody of itself.

239
Curses / Re: Can't go fight evil
« on: May 10, 2015, 09:31:02 pm »
Do you have any squads defined? You cycle through them with [Tab] on the main menu. You can check existing squads in the "[R]eview Assets and Form Squads" menu.

If it wasn't selected properly, it was probably because of your stay in the clinic.

240
General Discussion / Re: MSPA Homestuck
« on: May 08, 2015, 04:55:46 am »
Rails before pails!
I will cherish this


Also is this comic approaching some kind of event horizon of Oedipal fumbles and hateflirting

Pages: 1 ... 14 15 [16] 17 18 ... 243