ID:1352799
 
(See the best response by Ter13.)
Problem description:

I'm currently adding a feature where you could call your Pokemon and have it follow you.


I found the pokemon overworld sprites ...separated in multiple PNG frames, like so: northfram1.png, northfram2 , southfram1,southfram2 etc...

And that would mean i'd have to make the animation MANUALLY in the Move() proc


I was wondering ...Would this be heavy on server? and If not, what is the best way to do it. Note that this is an online game not single player.

Thanks in advance.
You can create directional movies with icons. You want to import your sprite sheet into a .dmi file, and use the tools that BYOND has made for you.

BYOND allows you to create "movies" that have frames and directions (up to 8).

Your method is definitely not using the tools that BYOND has given you, so it will be slower than the already-implemented approach.

Remember, there's no code faster than no code. Meaning, if you have to write code to do something that is part of the subsystem, you are automatically going to be losing speed.
LOL I didn't explain myself correctly. Sorry.

Basically it's not a sprite sheet. It's a zip pack having 500 Pokemon icons. Instead of being animated gifs. They are PNGs seperated in multiple frames and directions. (001SouthFrame1.png,001SouthFrame2.png,001NorthFrame1.png,001 NorthFrame2.png and so for the 500 Pokemon)

I can't really import all of them. I'd be just wasting a LOT of time.

I was wondering if having the animation done manually in the Move() proc would be eating too much CPU or not since it'd call an icon change for each movement.
In response to Kidpaddle45
He just explained that: DM icons perform faster than coding in the animations.

It's just something you'll have to do. Get some iconner friends to help you compile them into .dmi as proper animations.

You could go ahead and do it in Move(), but that's lazy.
You might want to look into these.

http://www.byond.com/developer/Falacy/IconImport
http://www.byond.com/developer/DarkCampainger/ SpriteSheetImporter

Or at least incorporate methods from each to import the north south etc into a .dmi
Tried those. Won't really help but yeah thank you all for the posts. I think this is just useless for now. It was only there for visuals anyways.
In response to Kidpaddle45
Kidpaddle45 wrote:
Tried those. Won't really help but yeah thank you all for the posts. I think this is just useless for now. It was only there for visuals anyways.

I'm sorry, but I can't take your complaint about the time taken to produce images when all you've done is download a zip archive of copyrighted images.

Do you have any idea how long it took to make the graphics for my most recent tutorial project? First person games in BYOND I've spent over 90 hours agonizing over an import/export method for my 3D renders, writing complex shaders, configuring the rendering pipeline, and writing my own batch import and cropping application. And that's not even mentioning the literally thousands of hours I've put into developing the skills that allowed me to do all of this.

It would take you less than an hour to learn to use one of those importers, or write your own. Whatever, though. If you can't be bothered to do the work, that's your problem.
You just didn't understand what I need at all and went attacking me, calling me lazy. A programmer is always willing to find the fastest and best way to do things.

Anyways, I did not use the tools becaue they are used to convert sprite SHEETS into DMI animations. What i got aren't sheets but individual frames in PNG for over 500 Pokemon. Which means 500 x4 (4 directions) x2 (theres 2 frame for each direction)= 4000 Individual small 32x32 png file.

There is no way i could convert these using the tools you showed me. I could try to create my tool but that wasn't the point. I only wanted to see if it was possible to use the PNG files and manually create the animation but you just went ahead and called me lazy and unable to use the tools you've shown me. >.>

I have also seen your work on 3D rendering and read your article, it was very interesting and you definitely got a lot more patience. xD
If they are all named similarly you could loop through them pretty easily importing them to DMI files.
In response to A.T.H.K
A.T.H.K wrote:
Or at least incorporate methods from each to import the north south etc into a .dmi

Seriously should consider this, if you are looking for an easy way to do it with less stress on the server.
Best response
If someone took the time to dump all of those icons into a repository, there is most likely a methodology to their labeling or ordering.

As such, you can easily write a batch importer, then save the result as a .dmi in the proper format.

var/icon/importicon = new/icon()

var/icon/tempicon

for(var/filename in flist("./path/to/file/")
tempicon = new/icon(filename)
importicon.Insert(tempicon,"statename",dir,framenum,moving,delay)

usr << ftp(importicon)


You just need to determine the format, and determine how the icons will be inserted into the file.

Listen, I do apologize about the tone of my last post. I'd just gotten off work, and I was still in stressed-out mode from having to listen to other people whine about their technical problems all day. You are right. I was out of line with my rebuke. I know I'm not an overly nice person, but I'm working on it.

You can actually use code to position the animations in the right order. Take a look at the format of the Insert proc. It will help you do this. I'd say it'll take you maybe a half hour to write the batch importer verb tops, and 30 seconds or less to import them all into useable icons.

Once you've got them exported into .dmi format, you can actually never bother again. Just put the .dmi the ftp() exports into your project and you can use the images like normal.
It's fine & Thanks a lot this is really appreciated.
You are right the files are named numerically. Gonna try the method you suggested.
Was this:
tempicon = new/icon(v)

supposed to be:
tempicon = new/icon(filename)
? O.o
I'd have to let Ter13 answer this, but I'd say this is probably the case. It looks like he tried to CTRL+C and CTRL+V the string "filename", and slipped on the CTRL. An honest mistake.

But yeah, he'll have to clarify for sure.
yeah, I forgot to edit the second reference to the variable. I renamed it to make it more clear.