[Solved] Some random stuff

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
zooks97
Prole
Posts: 11
Joined: Wed Jan 01, 2014 6:22 pm
Location: United States

[Solved] Some random stuff

Post by zooks97 »

Löve nub trying to remake mmo side scrolling platformer (Maplestory) to learn löve, wants help with theory of

Different Threads
  • 1.How to mirror character with 4+ individual parts, animations, and eventually armor and weapons
  • 2.Best way/how at all to creat collision for the character and enemies (with walls, floors and eventually enemy attacks)

Far in the future
  • 3.How to create an armor/weapon system
  • 4.How to create a window-based, drag-and-drop capable UI
  • 5.Best way to work character customization

Link to .love download:
Version 1:
  • Character floating in air, some grassy textures
Version 2:
  • Borrowed some code for character gravity, jumping, and floor from another post (/viewtopic.php?f=4&t=76840)
  • Reduced texture redundancy
  • Slowed character movement to value found in gamefile
Version 3:
  • Implemented AnAL, Alert-Face idle animation, Light-skin body idle animation, Light-skin arm idle animation
  • Added a real map background, moved floor level to match
  • Added jump sound, map-appropriate BGM
  • Changed jump height to value found in gamefile
Last edited by zooks97 on Sat Jan 04, 2014 1:40 am, edited 7 times in total.
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Re: [Need Help] Customizable character, physics, animation,

Post by Ref »

What an awful mess.
You're already up to almost a meg of redundant image files that don't even line up properly.
I would be tempted to put only the unique images into a spritesheet of constant size sprites for each feature (aligned so that you could interchange features without using different positioning.)
To animate, use tables to contain sequence of images you want and then index through the table based on time.
love.graphics.draw(body[time], x+7, y+33)
if changed, then add
love.graphics.draw(head[time], x, y)
love.graphics.draw(larm[time], x+23, y+35)
love.graphics.draw(face[time], x+2, y+16)
love.graphics.draw(hairtop[time], x+1, y-1)
User avatar
zooks97
Prole
Posts: 11
Joined: Wed Jan 01, 2014 6:22 pm
Location: United States

Re: [Need Help] Customizable character, physics, animation,

Post by zooks97 »

Ref wrote:What an awful mess.
You're already up to almost a meg of redundant image files that don't even line up properly.
What would be the best way to check for redundancy in, say, the /character/hair/male/metro - not done/ folder where there are some textures with only minor differences? Is it just going to come down to looking at every texture? I'm working on getting rid of the redundant face textures, but i'm not sure which emote faces are exactly the same between face types, or if they all are. Also, do you have any tips for the skin types? Would adding a filter to a base (light skin type) work?
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Re: [Need Help] Customizable character, physics, animation,

Post by Ref »

Really not sure where you're going with this.
It really not necessary to have black, blue, brown, pale versions of every image.
Pale images can be colored using love.graphics.setColor when drawing.
This reduces your image files down to ~34k.
It appears that the images are designed to be used as skins which requires a lot of information about the images - the arms in your case.
Need to know where the attachment point for each part and the point where subsequent parts will be attached ( something like foot attached to lower leg attached to the upper leg attached to the body.), need to know how this part will move when the part it is attached to moves, ...
Collisions become more complex because you have to create a bounding box for the overall figure which changes with time. There is a commercial program that deals with this or you can create your own code.
If you also what to use the physic module - lots of luck - steep learning curve.
Suggest you design a simple sub-project to get your feet wet before getting to involved - something like an animated face or a walking figure.
Then decide if you want random movement (tween) or grid based (using path finding to avoid obstacles).
Ultimately, you will have to come up with a class system to handle all the figures you will be using.
Start out simple so success rate is high.
Lots of luck.
User avatar
zooks97
Prole
Posts: 11
Joined: Wed Jan 01, 2014 6:22 pm
Location: United States

Re: [Need Help] Customizable character, physics, animation,

Post by zooks97 »

Right now I'm not concerned with the other skin colors, but in the end they would be something I'd want to figure out. The skin textures are shaded individually, so a fill won't work without degrading looks. The only parts for the actual base body that have to be stitched together are the left arm, head(unchanging), body, face, hair, and sometimes(I'm not worried about this now) another hand. Physics for the character will only need to be one collision rectangle and gravity for the character, but the rectangle will eventually need to be able to change with the prone state. Enemies use random movement until being attacked, after that they may need collision avoidance / path finding, but that's very far in the future. At the moment, all I really want to do is make an easily reproducible way to construct collision / floors over .png images I have of the maps, be able to mirror the character and their equipments, and deal with animations when that happens.

--Animations--
At the moment, I have idle animations (using sprite files with AnAL) working for eyes, body and arm, however I don't know how I would want do deal with mirroring those animations because mirroring the whole image would make the animation run in reverse. The next animation job I'm going to finish is a walking animation which should be as simple as the idle animation, but I don't know how to stop the idle animation and replace it with the walking animation. All armors / weapons already have animated frames that I can place in files for AnAL to use.

--Collision / Jumping / Falling--
Now, I'm using a system that I found in another thread for this, but it seems that it either falls apart or I code it wrong when I want to add another floor (i.e. a platform) in addition to the ground level. I'm interested in learning how to do this using love.physics but like you said, there's a steep learning curve. So, I've put that on the back burner and am trying to tackle animations and mirroring.

Thanks for helping :awesome:

TL;DR
Only interested in using the light skin right now, others far in the future. Everything is easy to animate using AnAL, no complicated physics needed for that. The only physics needed are just some collision and gravity for the character as a whole (one box will do). Enemies are far in the future, but right now animations are the focus: how to mirror, how to transition between, best way to add and format in code (make a class for them?). And thank you for helping! :awesome:
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests