Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Simple question, can DF use .gif's instead of .png's?  (Read 1680 times)

sambojin

  • Bay Watcher
  • Three seconds to catsplosion and counting.......
    • View Profile
Simple question, can DF use .gif's instead of .png's?
« on: September 12, 2010, 07:20:30 am »

All the tilesets I've seen seem to use .png file format. I was wondering if DF can load up .gifs instead? And if it can, does it have the capability of animation frames in the .gif file?

I was thinking of knocking together a little graphics pack, but it will be a little pointless without the ability to animate the graphics. I know that each file is divided up into tileblocks of a particular size (16x16 usually) so it might be a little screwy for Toady to code (but not very). Even if they do just cycle through available frames for each tileblock from the graphic file every so often(linked to FPS I guess), it would make the game a lot prettier (with very little extra size/speed/memory requirements considering all the things DF does anyway).

Simple question, and rambling. So is it worthwhile me making up an animated gif for DF?
Logged
It's a game. Have fun.

Rhenaya

  • Bay Watcher
  • Usstan tlun natha hargluk ssinssriggin ilythiiri!
    • View Profile
    • X-Fire Profile
Re: Simple question, can DF use .gif's instead of .png's?
« Reply #1 on: September 12, 2010, 08:14:40 am »

just a simple question because i dont know the answer: why dont you try it with a single creature?
Logged
User Profile: http://df.magmawiki.com/index.php/User:Rhenaya
Mods: http://dffd.wimbli.com/who.php?id=554

From "Angroshs Kinder" Das schwarze Auge Zwergenhandbuch - (Angrosh Children, the dark eye, german pen&paper, dwarven handbook):
"Elves!? Their men dont wear beards, and their women bathe nacked to lure you into the water and drown you. Thank Angrosh they are as ugly as the day and all big and skinny."

TomiTapio

  • Bay Watcher
  • OldGenesis since 2012
    • View Profile
    • My Flickr animal photos
Re: Simple question, can DF use .gif's instead of .png's?
« Reply #2 on: September 12, 2010, 08:33:43 am »

All the tilesets I've seen seem to use .png file format. I was wondering if DF can load up .gifs instead? And if it can, does it have the capability of animation frames in the .gif file?
Simple question, and rambling. So is it worthwhile me making up an animated gif for DF?
Animation will not work. Others would have done it already if it was possible. Just use PNG and have fun with the foreground and background colors being able to be specific to each plant. (see Genesis mod V3.12 or others)
« Last Edit: September 12, 2010, 09:28:17 am by TomiTapio »
Logged
==OldGenesis mod== by Deon & TomiTapio. Five wood classes, four leather classes. Nine enemy civs. So much fine-tuning.
47.05e release: http://dffd.bay12games.com/who.php?id=1538
OldGenesis screenshots: https://twitter.com/hashtag/OldGenesis?src=hashtag_click&f=image
My Finnish language file: http://dffd.bay12games.com/file.php?id=14884

Eagle_eye

  • Bay Watcher
    • View Profile
Re: Simple question, can DF use .gif's instead of .png's?
« Reply #3 on: September 12, 2010, 04:00:18 pm »

perhaps you could somehow afflict all living creatures with a fairly harmless condition, and replace the flashing that goes along with that with another version of the creatures sprite, so you would have a very basic animation.

EDIT: Sorry if that's not coherent, I'm tired today.
Logged

sambojin

  • Bay Watcher
  • Three seconds to catsplosion and counting.......
    • View Profile
Re: Simple question, can DF use .gif's instead of .png's?
« Reply #4 on: September 12, 2010, 04:59:03 pm »

Fair enough, a fair bit of tweaking and syndromes might do the job then. I'll have a play around with the standard "miner" dwarf and see how it turns out.

Or do a "pretty please" request to toady with a donation. Between slightly animated tiles (trees in the wind, sparkling gems etc) and some sound effects it would be a great little modding project. Although, with graphics packs getting better all the time and soundsense providing customisable sound, dwarf fortress is kind of looking a lot better for the new player to get into as it is.
Logged
It's a game. Have fun.

McBeer

  • Bay Watcher
    • View Profile
Re: Simple question, can DF use .gif's instead of .png's?
« Reply #5 on: September 12, 2010, 05:03:19 pm »

Quote
Or do a "pretty please" request to toady with a donation.
this is ridiculous.
yes, i am aware about [reactions]

Quote
Simple question, can DF use .gif's instead of .png's?
forget about it.
for years there was zero progress at crucial gui matter, so possibility of making something as 20 y.o. ultima simple gfx engine(ultrasimple gif anims) is truly out of reach here.
yes, i am aware about [reactions]

yes, i am tired today too.
btw, i am glad that DF is not Mario Bros already.
(topic unsuscribed for preventing mailbox abuse, g'night)
« Last Edit: September 12, 2010, 05:12:42 pm by McBeer »
Logged
fun is for rich men, i assume.
----------
My axe is sharp and my beard is strong.

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Simple question, can DF use .gif's instead of .png's?
« Reply #6 on: September 12, 2010, 05:04:24 pm »

perhaps you could somehow afflict all living creatures with a fairly harmless condition, and replace the flashing that goes along with that with another version of the creatures sprite, so you would have a very basic animation.

EDIT: Sorry if that's not coherent, I'm tired today.
Huh, that's the weirdest proposal ever, and it's the same for all creatures, so what's the reason?
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

sambojin

  • Bay Watcher
  • Three seconds to catsplosion and counting.......
    • View Profile
Re: Simple question, can DF use .gif's instead of .png's?
« Reply #7 on: September 12, 2010, 05:15:25 pm »

I was thinking of it more for landscape objects (gems, ores, trees) then dwarves etc at the start. Just to add a little sparkle to the scenery. Which is a bit stupid to do to an ascii based game I guess.

Unfortunately the affliction thing probably wouldn't work for trees etc making the point moot. I wonder if you can loop life cycles (baby->child->dwarf) back on themselves, very quickly. A mighty 3 frame animation for exactly 1 dwarf type in your fortress :) And two frames for creatures!!!!! I'm pretty sure it's in one year increments though :(.

I really haven't done any modding other than the odd RAW tweak/change, so I'll post back in 3 months when I've tried a bit and know what I'm talking about.



Logged
It's a game. Have fun.

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Simple question, can DF use .gif's instead of .png's?
« Reply #8 on: September 12, 2010, 05:17:01 pm »

You can't do it yet. Just wait for it to be implemented, read Ironhand topic for more info.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

sambojin

  • Bay Watcher
  • Three seconds to catsplosion and counting.......
    • View Profile
Re: Simple question, can DF use .gif's instead of .png's?
« Reply #9 on: September 12, 2010, 05:20:25 pm »

Will do.

Now I think about it, the life cycle looping would not only run out in the sense of RAW space (each animation frame would need to be defined as a "thingy" if it cant go baby->child->dwarf->baby.....), the message spam would be horrendous.

"Urist McAni(frame1) grows into a Urist McAni(frame 2)"
"Urist McAni(frame2) grows into a Urist McAni(frame 3)"
"Urist McAni(frame3) grows into a Urist McAni(frame 1)"
"Urist McAni changes pose slightly."
"Urist McAni changes pose slightly."
"Urist McAni changes pose slightly."
For every dwarf with a life cycling animation frame, every frame.

I guess it's off to play with a microphone to add soundsense stuff instead.
« Last Edit: September 12, 2010, 05:28:15 pm by sambojin »
Logged
It's a game. Have fun.

sambojin

  • Bay Watcher
  • Three seconds to catsplosion and counting.......
    • View Profile
Re: Simple question, can DF use .gif's instead of .png's?
« Reply #10 on: September 13, 2010, 12:21:38 am »

Errrrmmmm, more rambling/ranting (and a free double post with every view).

Actually, what graphic library does DF use? It's just a thought, but virtually any lib that can load a .png file has a tendency to be able to load a .gif (with animation frames supported).

From a game back->front end, no-one wants DF to run slower. But really, addressing a slightly larger memory array (or object as it is) isn't a true problem for the game. I've always thought that the time it takes to render the current viewport is actually one of the last (and least) forms of calculation/cpu work that DF does. And the option to load a .gif rather than a .png takes place quite a bit before the player sees their embark.

I know it was originally envisioned as a truly cross-platform game, but then again .gif's are as portable as .png's these days. Looking at my memory allocation of DF in text mode and looking at it with a graphics pack is somewhat similar. Temperature, fluids, pathing, etc take up a lot more cpu time then viewport access. What's a 5 megabyte, 5 frame animated graphic pack compared to a 1 megabyte, 1 frame one when both the game and the background music will happily chew ten times this (more for the game's memory).

I tend to think, that if the game can support TT fonts to both render the GUI and the basic game in text(and all the cpu cycles wasted to do so) then it can support a very simple tile-block loadable format for graphics.

.gifs:
256 colours (oh the many colours of the IBM 80286 era).
Transparency (and foreground/background colours for switching/alphas).
Frames/delays implicit in the file.
Frame sequencing implicit in the file.

.png
Transparency of sorts
Slightly compressed loss-lessly (irrelevant compared to say background music/a single save file's size).

It's not really a feature I'm asking for. Just another file format to load graphics from. I used .gif's all the time about 15 years ago using TP 6.0 (and the SPX library, such good computer speaker sound). Graphics overhead compared to game/back-end overhead was pretty small.

If the graphics pack doesn't look good, slows it down or is buggy, then people won't download it.

How many graphics modders would like the OPTION to load a .gif? Nothing to do with the game, just a file format that you can sort of mess around with (alot :)  )
« Last Edit: September 13, 2010, 12:27:37 am by sambojin »
Logged
It's a game. Have fun.

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Simple question, can DF use .gif's instead of .png's?
« Reply #11 on: September 13, 2010, 02:41:09 am »

So if it's not a feature you're asking for, what is it? Just a discussion how cool would it be? Then it doesn't belong to the modding forum.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Eagle_eye

  • Bay Watcher
    • View Profile
Re: Simple question, can DF use .gif's instead of .png's?
« Reply #12 on: September 13, 2010, 03:59:18 pm »

deon, the intent was, you would afflict each animated creature with a DIFFERENT harmless affliction. Obviously, this would limit the creatures that could be animated, but important ones, like megabeasts, could have a little more flavor. Also, sea monsters could be "drowning", dragons "on fire" etc, as they are immune to those. I think.
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Simple question, can DF use .gif's instead of .png's?
« Reply #13 on: September 13, 2010, 04:05:54 pm »

But still the "flickering" images are the same: it's the "plus" tile.

And drowning etc.are states, not afflictions, and they are always a down arrow or "!".
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository