Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 151 152 [153] 154 155 ... 329

Author Topic: Ironhand's Graphics Set (on Hiatus)  (Read 1246452 times)

Vince

  • Bay Watcher
    • View Profile
Re: Ironhand's Graphics Set (still waiting for 0.50...)
« Reply #2280 on: August 13, 2010, 05:01:13 am »

Quote
You can use almost arbitrary code (though if statements are slow and to be avoided)
How should we test the neighborhood of tiles without a considerable amount of if statements?
Or am I overlooking something here?

..hello, i'd like to apologize eveyone for my yesterday's posts. I'd like you to know i respect you guys, even if it looks different sometimes..
That would be all.
Apology accepted! :)
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Ironhand's Graphics Set (still waiting for 0.50...)
« Reply #2281 on: August 13, 2010, 05:23:41 am »

I find nothing wrong in a dwarf being a bit impolite. We're on dwarf fortress forums, guys :). Let's respect each other and sometimes TANTRUM. That's expected and that's okay.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Ironhand

  • Bay Watcher
  • the llama is laughing
    • View Profile
Re: Ironhand's Graphics Set (still waiting for 0.50...)
« Reply #2282 on: August 13, 2010, 07:07:50 am »

Indeed. You are completely forgiven.

So I'm totally stoked about changing all the .;`' tiles and the food crate tile when it's in the walls.
But I just thought of something that is just absolutely totally RIDICULOUS... You guys ready for this?

MULTI-TILE CREATURES.

What's that? I see a dragon in that tile?
Let's put wings to either side and a tail behind it!

You could use it to make trees span multiple tiles too!


...I dunno, will that actually work?  = P
Logged

Baughn

  • Noble Phantasm
  • The Haruhiist
  • Hiss
    • View Profile
Re: Ironhand's Graphics Set (still waiting for 0.50...)
« Reply #2283 on: August 13, 2010, 07:13:25 am »

How should we test the neighborhood of tiles without a considerable amount of if statements?
Or am I overlooking something here?
Well, first off, you can use if statements. "Slow" is not the same as "doesn't work", though it might end up the same on some older/laptop GPUs.

But there are usually alternatives. A simple example:
Quote
int left = get_tile(x-1, y);
int here = get_tile(x,y);
int right = get_tile(x+1, y);
out_tile = here;

if (here == DOOR) {
  if (left == DOOR && right == DOOR)
    out_tile = DOOR_CENTER;
  else if (left == DOOR)
    out_tile = DOOR_RIGHT;
  else if (right == door)
    out_tile = DOOR_LEFT;
}
Instead of writing that, which would be rather slow, you can do this:
Quote
int left = get_tile(x-1, y);
int here = get_tile(x,y);
int right = get_tile(x+1, y);
out_tile = here;

if (here == DOOR) {
  int candidates[4] = int[](DOOR, DOOR_LEFT, DOOR_RIGHT, DOOR_CENTER);
  out_tile = candidates[(left == DOOR) + (right == DOOR)*2];
}
That's still got an if, but much fewer of them, and it's probably entirely possible to remove that one as well - I just haven't. Illustrative, I hope.

(Oh, and I'll be providing functions like get_tile. Don't worry. Though the real one will provide tile id and color at the same time, to improve performance.)
« Last Edit: August 13, 2010, 07:16:59 am by Baughn »
Logged
C++ makes baby Cthulhu weep. Why settle for the lesser horror?

Baughn

  • Noble Phantasm
  • The Haruhiist
  • Hiss
    • View Profile
Re: Ironhand's Graphics Set (still waiting for 0.50...)
« Reply #2284 on: August 13, 2010, 07:14:27 am »

And sure, something as simple as drawing a dragon across multiple tiles would be trivial.

Heck, you could use a geometry shader and do actual 3D. (Subject to input limitations. You don't get any more data to work with.)

Though I don't know what the performance of that would be. :P
Logged
C++ makes baby Cthulhu weep. Why settle for the lesser horror?

Vince

  • Bay Watcher
    • View Profile
Re: Ironhand's Graphics Set (still waiting for 0.50...)
« Reply #2285 on: August 13, 2010, 07:20:25 am »

Quote
Well, first off, you can use if statements. "Slow" is not the same as "doesn't work", though it might end up the same on some older/laptop GPUs.
I know :)
Quote
if (here == DOOR) {
  int candidates[4] = int[](DOOR, DOOR_LEFT, DOOR_RIGHT, DOOR_CENTER);
  out_tile = candidates[(left == DOOR) + (right == DOOR)*2];
}
That's still got an if, but much fewer of them, and it's probably entirely possible to remove that one as well - I just haven't. Illustrative, I hope.
Gah, that was it! *slaps forehead* Boolean arithmetics! I KNEW there was something I did not think about. I feel so stupid now. :D

Edit: I fixed it, of course!
« Last Edit: August 13, 2010, 08:50:56 am by Vince »
Logged

Ironhand

  • Bay Watcher
  • the llama is laughing
    • View Profile
Re: Ironhand's Graphics Set (still waiting for 0.50...)
« Reply #2286 on: August 13, 2010, 07:23:51 am »

Oh, yay!!! <3

And the code looks like Java,
so I should be able to crank it out.
Logged

Baughn

  • Noble Phantasm
  • The Haruhiist
  • Hiss
    • View Profile
Re: Ironhand's Graphics Set (still waiting for 0.50...)
« Reply #2287 on: August 13, 2010, 07:25:24 am »

Vince: The code you quote was broken. I fixed it. Please fix your quote, to avoid confusing people. :P

Or just assume they'll read this.  ???
Logged
C++ makes baby Cthulhu weep. Why settle for the lesser horror?

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: Ironhand's Graphics Set (still waiting for 0.50...)
« Reply #2288 on: August 13, 2010, 07:38:42 am »

Wait, since you're now more or less "in charge" of the graphics output, can you do another thing? I've always wanted to see "true 2.5D" in DF. This would be achieved by having tiles slightly taller than the grid, and drawn to the screen row-by-row, so that the items (and walls, etc) "closer to the camera" would partly obscure those "further" from it. Do you think it'd be possible?
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Ironhand

  • Bay Watcher
  • the llama is laughing
    • View Profile
Re: Ironhand's Graphics Set (still waiting for 0.50...)
« Reply #2289 on: August 13, 2010, 07:43:40 am »

Heheh. It just looks at tiles based on their comparative location to the one being drawn.
So I can still do art that's bigger than 3x3 tiles, by looking farther than 1 tile in each direction.

One thing I'm thinking is decorative floor/wall engravings that repeat every 5 or 6 tiles instead of every one.
How about something with dragonfire? I feel like we could make that look incredibly cool with a bit of work.


As for the 2.5d thing... I'm not sure. I feel like it would look really jumpy with re-drawing and everything,
since it's only the top layer of the tile that we get to look at. I'm going to try to stay fairly close to the
original tileset, at least as a start, to minimize that problem. So I guess what I'm saying is don't count on it.
Logged

Ironhand

  • Bay Watcher
  • the llama is laughing
    • View Profile
Re: Ironhand's Graphics Set (brainstorming ideas for the new tile format!)
« Reply #2290 on: August 13, 2010, 08:02:06 am »

Also, somebody asked when 0.50 will be released.

0.50 doesn't exist yet. Not even on my computer.
That's not gonna happen until I get my hands on the new tile stuff
and true type font that's gonna be in the next official Toady/Baughn release.

However, I think I'll put together a little something to keep you all happy until then.
If I haven't posted it by tonight, it'll be up by noon tomorrow.
So Wormy, send me anything you've done that I don't have.
Logged

Ironhand

  • Bay Watcher
  • the llama is laughing
    • View Profile
Re: Ironhand's Graphics Set (brainstorming ideas for the new tile format!)
« Reply #2291 on: August 13, 2010, 08:06:03 am »

'nother question:

Will these tiles always use the colors that they originally had?
Or are they like graphic objects, so they don't take overlays at all?
Or is there a way we can define the colors that are used by the tile?
Logged

Tormy

  • Bay Watcher
  • I shall not pass?
    • View Profile
Re: Ironhand's Graphics Set (still waiting for 0.50...)
« Reply #2292 on: August 13, 2010, 08:07:47 am »

And sure, something as simple as drawing a dragon across multiple tiles would be trivial.

Heck, you could use a geometry shader and do actual 3D. (Subject to input limitations. You don't get any more data to work with.)

Though I don't know what the performance of that would be. :P

Yeah, but the dragon itself won't "occupy" more tiles actually, only one, just like now. Am I correct? Example:

x= multi-tile gfx additions [tail, wings etc.]
X= position of the dragon
D= Dwarf

Code: [Select]
           xxx
           xXx
           xxx   D

So what happens when D [dwarf] tries to move to tile x? I suppose the dwarf's tile image will overwrite the dragon wing's tile image for example?
« Last Edit: August 13, 2010, 08:09:37 am by Tormy »
Logged

Ironhand

  • Bay Watcher
  • the llama is laughing
    • View Profile
Re: Ironhand's Graphics Set (brainstorming ideas for the new tile format!)
« Reply #2293 on: August 13, 2010, 08:09:46 am »

Right.

Except actually, the way I'm imagining doing it,
the wing would cover up the dwarf rather than vice-versa.

But I suppose it would be pretty easy to toss a boolean in there
if you want to check for dwarves and not draw a wing if it's covered.

EDIT: To clarify.
None of this stuff is capable of changing game mechanics.
Think of it like a visualizer or something, rather than a game mod.
« Last Edit: August 13, 2010, 08:11:34 am by Ironhand »
Logged

Baughn

  • Noble Phantasm
  • The Haruhiist
  • Hiss
    • View Profile
Re: Ironhand's Graphics Set (brainstorming ideas for the new tile format!)
« Reply #2294 on: August 13, 2010, 08:11:37 am »

Yeah, you'd have to account for that. It won't change how the game works at all, just the visuals.

Ironhand: The tile color is something that's explicitly set, pixel-by-pixel, in the fragment shader. You can use the input color you get from DF.. or use the neighbour's, or mix with the neighbour's on tile edges using a pseudo-random perlin noise function, or make it up from scratch. Whatever.

Also, the next release will not have this code in it, just the preliminary truetype stuff. This is going to take a while to get completely working. The one after that, probably.

Lastly, do keep in mind that you'll have the absolute map location of each tile. You don't need to look at neighbours to make them repeat every N tiles instead of every 1 (or even make them not repeat at all, using noise functions), just the location.
Logged
C++ makes baby Cthulhu weep. Why settle for the lesser horror?
Pages: 1 ... 151 152 [153] 154 155 ... 329