Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Sprite Modeller and Animation System

Author
Message
puzzler2018
User Banned
Posted: 17th Dec 2018 12:38 Edited at: 17th Dec 2018 16:34
Thought to put this into its own thread otherwise will get lost into the ether - as it was in the Lemmings thread - indeed of which doesn't really belong there.


Thought to create a small 2D Sprite modeller and animation system. There maybe ones already around but thought to have a go myself too.



Still quite a bit to do im sure. as it just works with 32 x 32 sprite sets at the moment.

and various other things still left.

Thought it may make things a little easier building animation sprites.

Max is 32 x 32 sprites and a maximum of 32 in one animation an all that funky stuff.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 17th Dec 2018 16:06
TomToad
6
Years of Service
User Offline
Joined: 6th Jan 2018
Location:
Posted: 17th Dec 2018 16:30
got this error when trying to run the code.
Error: Failed to write byte to memblock 100002, offset 3612 is greater than memblock size 3612 in main.agc at line 323 in main.agc at line 323
puzzler2018
User Banned
Posted: 17th Dec 2018 16:34
For the minute put the SetErrorCode(1) at top of code until I figure that out - that's an odd one

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 17th Dec 2018 16:53
I got that error aswell but I think it happened after I created 2 frames and hit previous 3 or more times
fubar
puzzler2018
User Banned
Posted: 17th Dec 2018 17:19
Ok cool - found it - its the boundary on the pallete

if you replace the GetPixelColor function with this one




Let me know how get on
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 17th Dec 2018 17:24
Great Work btw
Would really be handy for in game design systems like Cliff uses to allow
world customization

Give yourself a pat on the back
fubar
puzzler2018
User Banned
Posted: 17th Dec 2018 17:28
Thanks - i had a look at Cliffs and didnt realise it was a sprite animation thing too. My apologies Cliff.

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 17th Dec 2018 17:30
NO I don't think it has sprite animation only creation of sprites
from my understanding too. but this paves the way for both
in games
fubar
puzzler2018
User Banned
Posted: 17th Dec 2018 18:02 Edited at: 17th Dec 2018 18:03
Ok cool,

I might add little functions like to draw

- Line
- Circle
- Rotate - could be useful if rotating images on a animation
- Shift left/right/up and down - Could be useful if creating a button like an Arrow going right..
- plus others
puzzler2018
User Banned
Posted: 17th Dec 2018 18:51
And also Interopolation

- Create the first sprite
- Create the last sprite

then it interopolates all the sprites in between from the first to the last.

That will be a big think here so bear with me on this one..
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 17th Dec 2018 19:44
It works like a charm now . The interpolation is a great idea...I've done it with 3D objects . Most animator progamms use this trick . You could also add the fill function ,maybe you've already thought about it .

Cheers.
I'm not a grumpy grandpa
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 17th Dec 2018 22:44
If your going to do interpolation, I'd say not just first and last, but also intermediary key frames.
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Xaby
FPSC Reloaded TGC Backer
16
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 17th Dec 2018 22:53
@Puzzler, it is to cool

millisec. per Sprite or time would be nice. And 2x or 3x now we have only full-zoom or 1:1

love your color-picker.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Dec 2018 22:55
looking great puzzle dude. this will be very handy
puzzler2018
User Banned
Posted: 17th Dec 2018 23:00 Edited at: 17th Dec 2018 23:00
Wow thanks you your repsonses

Intermediate frames. How could one work out that with one knowing what the finished frame should look like

Eg. first frame is blue leg - last frame is red leg, intermediate frames are the grays (as we dont know what those are) unless we tell it

Uhhhmmm. shall have a think

My artistry skills are shocking btw

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Dec 2018 23:03
Normally they will have pivot points and bone like joints that rotate.
I would have a bit of a look at Spriter and those products
puzzler2018
User Banned
Posted: 17th Dec 2018 23:05
Super - sure will..
Xaby
FPSC Reloaded TGC Backer
16
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 17th Dec 2018 23:12
you could use "lines" and tweening from AppGameKit, so the in-between points would be calculated by AppGameKit itself. But that would be all more a vector-animation thingly than a pixel drawing app
puzzler2018
User Banned
Posted: 18th Dec 2018 14:05
Thanks for your inputs and ideas guys, I will go with

- Fill
- Rotate
- Merge (this is the interopolation function)
- Circle
- Line
- Shift - this shifts the data in the array, either > < up or down.
- Add limb

Adding buttons is the easy part - now time to work hard putting it all into place

Does it look over crowded at all?


Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 18th Dec 2018 14:56
Ok cool - added the flood fill algorithm - seems to work nicely



Will do more later...

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 18th Dec 2018 19:22
Looking very good puzzle dude. Great functionality!
puzzler2018
User Banned
Posted: 18th Dec 2018 19:39
Thanks , hope it will be useful for all.

I been trying to get my head around a line algorythm especially go fit nicely in the drawing grid and think ive managed it




line=1 starts when the Line button is pressed and the left mouse button is pressed on the grid, then it changes to line=2 until the mouse button is released.

Mind is bamboozled, so shall do more after a fresh start tomorrow
puzzler2018
User Banned
Posted: 19th Dec 2018 10:54
Ok cool

The Line function is done - I hope...



Shall work on tidying up the GUI a bit, like make a much better palette and work on doing a circle and a square..

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 19th Dec 2018 13:33
Love it
the line and fill are great additions
fubar
puzzler2018
User Banned
Posted: 19th Dec 2018 15:55
Thanks - shall keep going at it - The Lemmings one is for January 2019 to work on anyway as my first game of the month so be worth while getting this in place before we start the 2D games.

Anyway moving to this, I have decided drastically that the system was too overwhelming, so I am making it look and feel more pleasantly pleasing.

You will see it more space to work - so theorectically can change the size of the sprites now from a fixed 32 x 32 to what we want - thats the goal

The buttons at the bottom are now off screen - but if you move mouse down to the bottom.

The menu panel will appear with the appropriate functions and features.

Looks nicer i think

Still lots work to do on this, but will send update later on with this mechanism

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 19th Dec 2018 16:57 Edited at: 19th Dec 2018 17:11
Does anyone know why an array structure takes up FPS too.

So like we say

dataforsprite as integer[ 32, 32 ]

do
sync()
loop

This gives a nice 200FPS if we set SyncRate to 0,0


but say we had

global dataforsprite as integer[ 128, 128 ]

do
sync()
loop

This gives a horrible 20FPS if set SyncRate to 0,0 and this decreases and decreases over time.

ok its memory allocation at the start but i didnt realise it affected performance this way too during a sync title too - to me its got nothing to do with sync stuff surely, sync stuff is graphical stuff surely

Whats is going on....


EDIT - Ignore me, found the cuprit



Now runs at 120+FPS on 128x128 sprites

Be back soon
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 19th Dec 2018 17:35
Hey ...you have a great tool here bro ...just tested and it even save littles sprite... I love it .

I had I little error in my test...the one about write byte ...that I gave a quick solution writing SetErrorMode(1) before line 547

Quote: "
Error:failed to write byte to memblock 100002,offset 3612 is greater than
membolock size 3612 in main.agc at line 547
"


We should pay you for this code ...
I'm not a grumpy grandpa
puzzler2018
User Banned
Posted: 19th Dec 2018 17:48 Edited at: 19th Dec 2018 17:49
Hey - thanks for your comments - ive always loved to do somthing like this.

Did you suggest that getting error still but this time in the ApplyImage command

Maybe a boundary thing again

If you could turn back off the errormodes and replace the ApplyImage function with this one



Let me know how get on

Ive changed the main code and will update soon with the new layout
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 19th Dec 2018 18:08
Not in Applyimage function....just triying to compile...but with seterrormode(1) it works as it should
I'm not a grumpy grandpa
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 19th Dec 2018 18:43
@puzzler2018
Sorry for my stupidness ...when su suggest to try your new Applyimage function, I was out and dindn't realized you need someone to test it again. I tested again turning off error mode, and I get the same error
I'm not a grumpy grandpa
puzzler2018
User Banned
Posted: 19th Dec 2018 18:50
This is going to really baffle me sideways cause runs perfectly ok on mine on all modes

If you could just leave it at mode(1) for now and future updates i send, ill make sure its (1) too.

Ill send the new design layout version by lunch tomorrow hopefully

Did you get the version with the fill and line functions?

chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 19th Dec 2018 18:54
Quote: "This is going to really baffle me sideways cause runs perfectly ok on mine on all modes"


What's your PC specs??
I'm not a grumpy grandpa
puzzler2018
User Banned
Posted: 19th Dec 2018 19:03
Windows 10

Laptop Lenovo Ideapad 700 (2.3Ghz turbo to 3.2Ghz)

4GB GRAM

12GB ordinary ram

HD doesnt matter

resolution wide 1920x1080

In the SetupSpriteData function, please remove (for now)



Its applying n image well before the main loop which i can see now, but does this bugger it up...





puzzler2018
User Banned
Posted: 19th Dec 2018 19:03
Windows 10

Laptop Lenovo Ideapad 700 (2.3Ghz turbo to 3.2Ghz)

4GB GRAM

12GB ordinary ram

HD doesnt matter

resolution wide 1920x1080

In the SetupSpriteData function, please remove (for now)



Its applying n image well before the main loop which i can see now, but does this bugger it up...





chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 19th Dec 2018 19:19
If I remove those lines :

Quote: "for spritenumber=0 to sprites.length
applyimage(spritenumber)
next"

I get an empy white hole where should be sprites .

That is curios ...I alwais thought that a sprite should be at least 0,0,1,1 but if we put :
Quote: "mouse= CreateSprite(getimage(0,0,0,0))
or even
setspritevisible(mouse,0)
"

GetSpriteCollision will work as it should. Just to avoid seeing the black pixel flying on the screen
I'm not a grumpy grandpa
puzzler2018
User Banned
Posted: 19th Dec 2018 19:20 Edited at: 19th Dec 2018 19:21
This looks more cleaner now, and supports any size (I hope)

The Frame functions will be indeed in the Frame tab
The Function functions, like Line, Fill, Circle will be indeed in the Functions tab
The Animation functions like Stop, Play, Delay, Loops will be indeed in the Animations tab
The Palette will be indeed in the Palette tab as a rectangular shape pallete

More tomorrow

EDIT - I have resolved it by removing these lines and making them invisible to start with and making each visible when indeed the image is applied.

Will be fixed in the next update!

Thank for checking it out thought

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 19th Dec 2018 23:02 Edited at: 19th Dec 2018 23:04
I love creating tools to be able to work better, quicker, and most of all, if it makes ones happy to do something to help others work better then im all for that

Must admit, im getting proud of this product, but its for developers making their time a little less stressful, instead of the old MSPaint!! - that would certainly do my tree in creating all those spriite sheets by hand
puzzler2018
User Banned
Posted: 21st Dec 2018 16:27 Edited at: 21st Dec 2018 16:27
OK cool - i have been racking my brain most of the time with a nice colour wheel

Think we have one now using Color Interopolation methods

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 21st Dec 2018 21:37
That looks absolutely gorgeous. Would it be ok if i worked up an interface for you?
puzzler2018
User Banned
Posted: 21st Dec 2018 21:41
Thanks - it took me a while to figure that one out...

Yeah sure, that would be great - my artistry skills are zilch! so id be honored but only if you ave time and are willing to.

Im moving things around left right and centre but nothing is coming to me to say Yeah thats the layout!!

Thanks
puzzler2018
User Banned
Posted: 21st Dec 2018 23:29 Edited at: 21st Dec 2018 23:31
Bugger it - I think i will implement 3D object modeling too into this - 3D is the way its going after all.

Yes there will be an exporter too for the models
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 21st Dec 2018 23:43 Edited at: 21st Dec 2018 23:43
I was thinking something along the lines of this


Blendo has some code for controls so I think i'll start there

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 21st Dec 2018 23:46 Edited at: 21st Dec 2018 23:48
Thanks - but this looks like a world modeller too and that would be going against Cliff which i dont want to do - but does give me ideas. with all the seperate windows for colors etc.

A world modeller as such is not what i want to acheive

But certainly looks good the way and feel a modelling suite should look like - easy access to everything

Thanks
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 21st Dec 2018 23:52
Nah. It's just a sprite painter. But the layout is what i though might me cool. It needs the sprite frames but essentially it's all there
puzzler2018
User Banned
Posted: 21st Dec 2018 23:53
thanks - ill get that altogether tomorrow
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 22nd Dec 2018 00:03
No rush at all. I'll have to get my head around blendo's window controls first
puzzler2018
User Banned
Posted: 22nd Dec 2018 00:08
They wont be an issue - the windows are inbuilt sprites (as a whole sprite) indeed with the function buttons attached to it

Just been able to know how to drag and drop sprites as the whole is the key really and have the origins of each command inside that sprite still intact.

Thats if you want moveable windows





blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 22nd Dec 2018 00:37
I think blendo's does all that along with editboxes, dropdown boxes, checkboxes and heaps of other stuff
puzzler2018
User Banned
Posted: 22nd Dec 2018 00:42 Edited at: 10th Jan 2019 20:10
im not using anyones code - I am a programmer and like to achieve something

If not, then what would you like to see be happening..

EDIT - Thanks Fubarpk and Chafari for your inputs-most welcomed

Login to post a reply

Server time is: 2024-03-29 10:07:03
Your offset time is: 2024-03-29 10:07:03