Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your feedback on a survey! Each completed response supports our community and gives you a chance to win a $25 Amazon gift card!


MrDaaark

Member Since 01 Aug 2001
Offline Last Active May 16 2013 07:14 AM

#5029230 What is the difference between "Entity" and "Sprite"?

Posted by MrDaaark on 05 February 2013 - 05:38 PM

The game logic will update all the data on the GameObject.Entity objects, and then the renderer will loop through those GameObject.Entity objects to use their positions and sizes, and it will draw them using the GameObject.Sprite data they are pointing to.


#5028952 Alpha Testing: I manage to "scorch" my edges

Posted by MrDaaark on 05 February 2013 - 12:36 AM

Are you not reading Hodgman's post?

Textures get filtered. When you render them, their values come from more than a single pixel. It doesn't matter what color they are, the surrounding pixels will have an affect unless you are using NEAREST or POINT filtering. So 1 pixel in the image will have alpha 1, and the next will have alpha 0. But when interpolated during rendering, you will get some that average out to 0.5.

Using a similar color on the surrounding transparent pixels will help a bit.

Using the pre-multiplied alpha technique will help a lot more.

http://blogs.msdn.com/b/shawnhar/archive/2009/11/06/premultiplied-alpha.aspx


#5028936 What is the difference between "Entity" and "Sprite"?

Posted by MrDaaark on 04 February 2013 - 11:31 PM

Great. You're suggesting that a GAME hasn't any reference to render code; instead, it might have a renderer subsystem that cares about it (which could be 2D or 3D, it won't affect the game logic). But then, how can I know how a entity could be rendered (or how can i bind it a sprite ) without have any "graphic" information on it?
 
Newly thanks to all

Beginners tend to mix all their game logic, rendering code, and input into one big mess.

A Game of course will have references to everything. But every component that a game is made up of only needs to know about itself. This is no different than a real machine.

I just made a cup of coffee in a single cup coffee maker. It is composed of a few subsystems that don't know about each other, but work together to solve the problem.

When I turn the unit on the main part asks the water tank if there is enough water. If it says yes, it turns on the heater for about 30 seconds. Then it says 'ready'.

This means I put my cup on the tray, and a coffee cartridge in the holder and close it. Then I press one of the brew buttons.

The machine sucks the water out of the tube and sends it to a little heater. Then it shoots it through the cartridge and out a hole. Then that drop of coffee lands in my cup.

All those little components do their job independently and don't know about each other. The tank heats on command and reports water level. The tube moves the water from point A to B. And finally the little nozzle thing heats that one drop to boiling point and shoots it through the cartridge and out of the machine.

The machine doesn't even know if there is a cup on the tray, or a cartridge in the slot! That's out of it's scope of responsibility. Just like any component in the machine, that's my single area of responsibility in the equation.

So, you can combine several types of things into a higher level thing.

class GameObject
{
Entity entity;
Sprite* sprite;
WhateverElse we;
}

Also, another example would be a resource loader. It just passes pointers to loaded objects, and doesn't know anything else about them.

When you create a gameobject you need to assign a sprite. You get it from the resource loader.

GameObject Paddle1;
Paddle1.sprite = ReourceLoader.GetSprite(".../Paddle.dds");

The GetSprite() will scan over it's list of loaded assets. If it finds ".../Paddle.dds" has already been loaded, it will simply return a pointer to it, and add 1 to the reference count. If it's not loaded, it will load the image, add it to the list of loaded images, add 1 to the reference count, and then return the pointer.

When you are done with your objects, you call ResourceLoader.KillSprite(".../Paddle.dds"), and that will simply decrease the reference count on ".../Paddle.dds". If the reference count reaches 0, it will be deleted from memory (or marked as free so another can be loaded on top of it).

The ResourceLoader knows nothing about the game or anything else outside of it's realm of responsibility. It just counts, loads, and passes out pointers to loaded assets on request.


#5028865 What is the difference between "Entity" and "Sprite"?

Posted by MrDaaark on 04 February 2013 - 06:42 PM


I'll go back to the pong example here.

The GAME code doesn't need to know anything about the graphical side. While it's very important that game be DESIGNED with all subsystems in mind, working in harmony, the actual coded sub-systems don't need to know or care about each other most of the time.

The paddle entities move back and forth either on player input, or a AI tick. The ball entity will move according to it's velocity, and will check other entities for collision. It doesn't need to know or care about resolutions, or sprites, or anything else.

The renderer will take the current state of the game and create an image that represents it. It will loop through the entities and render the proper sprite at the proper position for each one. The sprites don't need to know about anything except maybe how many unique objects are referencing them.

You can even replace the 2D renderer with a 3D one, and the gamestate and it's entities don't have to know, or even change, because of their single responsibility (as Ravyne puts it).


#5028829 What is the difference between "Entity" and "Sprite"?

Posted by MrDaaark on 04 February 2013 - 04:54 PM

And how can i managed sprites and entities in separated way? I think I need to read some resources about entities, and how interconnect it with sprites.

That's entirely up to you. Everyone's implementation is different.

If you are writing a simple game, they might not know about each other at all. Your rendering code will just loop through the list of things you want to draw, and hardcode everything.

If you were writing an engine, or a had a system with a generic entity that could be used for anything, you'd have a pointer or reference to a sprite to be used, along with all the other data that entity needed.


#5028754 What makes a good beat'em up game?

Posted by MrDaaark on 04 February 2013 - 01:26 PM

In addition to all the above points don't forget to add good sound in your game.
Perfect event based sounds does a very important role in engaging the game.

Correct. I made a point about this in my Konami rant.

Their beat em ups had HORRIBLE sound effects.



Here are much better sound effects in Batman Returns on SNES. This one of Konami's only good beat-em-up games.

Streets of Rage 2 has excellent SFX


The sfx of hitting people needs to be good and accurate because you are going to hear it 45,000 times in a short time period. smile.png Who the hell wants to listen to those Konami sfx over and over?

That video also features a point I forgot to make in my giant rant while I was busy finding good videos. There is a few more things for me to add, but I only seem to remember them when I'm not able to type them. smile.png

SITUATIONAL ATTACKS Situational attacks go a long way to avoiding repetitiveness. These are most visible in the batman and yakuza videos. When the attack button is pressed, look around to see what's actually going on around the player, and if the proper conditions are met, do an situational attack instead of the standard attack.


#5028739 What is the difference between "Entity" and "Sprite"?

Posted by MrDaaark on 04 February 2013 - 12:46 PM


Typically, and as simply as possible: These terms can and will be redefined, reused, and used interchangeably by other users and any engines.

In pong, the paddles and the ball are entities. A paddle entity would consist of a size and a position. The ball entity would be a size, position, and a velocity.

The sprites are the images that are drawn to the screen to represent those entities visually.

*Sprites are also soft-drinks and fairy like creatures. biggrin.png


#5028363 What makes a good beat'em up game?

Posted by MrDaaark on 03 February 2013 - 10:05 AM

I can say a ton on this. I love side scrolling beat em ups, and have been playing them non stop since 1990. The better ones still play very well and feel like they haven't aged a day since they came out. I am also working on one of these very slowly, and done a lot of thinking and research.

People always talk about these games being simple, repetitive, and mindless. But that's kind of the point. They are arcade style games, like pinball machines, and are meant to be simple fun. Once you start adding more complexity and other genre staples, they cease to be side scrolling beat em ups.

There is only one distinction that needs to be made to classify these I think, and that is whether or not the game was targetting the arcade, or a home console.
Arcade games were made to be extremely simple, and to make as much money as possible. So purely arcade style beat em ups have a little bit of a different design. Unlike a console, there are no set number of continues that you can use, and you can keep buying in until you go broke.

So enemies and levels are designed with a cost in mind. Best example I can think of is the factory level in Final Fight. There is fire shooting up through the floor randomly that takes a huge chunk of your health, and tons of enemies who are making it impossible to safely navigate through it. It's a very expensive level.

Also, special moves take a chunk out of your health! Special moves are used to break out of enemy holds before you throw you. So using them is a monetary decision. Using your special move to break out of a throw cost less than taking the full damage of being thrown.

Console based games are different. They focus on you trying to become really good at them, and then winning them within a limited number of lives. A lot of them also have extra content such as secret areas or alternate level paths and different endings.

I'll just throw up some random thoughts below. Basically about some things you could research or draw inspirtation from. Mostly the better games and what they do right and wrong.

---

Watch the Warriors! ( http://www.blu-ray.com/movies/The-Warriors-Blu-ray/61100/ )

The entire genre owes it's existance to this movie. When watching it now, you'll think it's like someone played a bunch of beat em ups and made a movie out of it. smile.png

It's about gang who gets framed for a murder at a big meeting where all the big gangs in NYC decide to unite and run the town because they outnumber the cops. The gang has to walk home from one end of NYC back to Coney Island, and they have to deal with the gang who runs every neighbourhood they pass through, just like the storylines in most of the games!

Warriors Trailer:


Warriors vs the Baseball Furies:


Warriors vs The Punks


Random gang montage


I believe it's on Netflix, and the blu is usually only ~10$. Other than the Beat Em Up connection, it's a classic movie with a cult following. I watch it every few months.

--- Games to play & study ---

River City Ransom / River City Ransom EX

The game Renegade was a complete shameless ripoff of Warriors, and not very good. It's follow up was much better though. River City Ransom is basically the Warriors with Highschool kids, and possibly the best beat em up that will ever be made.

There is some kind of student gang uprising, and the gangs start taking over various neighbourhoods. The player's girlfriend is being held on the roof of a highschool across town. So you have to walk from one end of town to the other to put a stop to everything.

The game is completely open world. You can run right to the other end of town in a few minutes if you want. The screen doesn't lock when enemies are attacking. You always have free roam, and every gang has about 20 unique members with their own sayings and quirks. Every gang also has slightly different fighting styles, and they move from area to area as you beat them down.

The gameplay is very dynamic. There are crude physics with all the weapons. They can be picked up, thrown, struck while they are in the air, ridden on, etc... You can even pick up downed opponents and use them to hit other opponents.

Your character starts out weak, but can improve their stats and abililties like an RPG. You get money for defeating your oppnonents and you can spend it at shops on food and new techniques. Your character has "groundhog day" like persistance (like Dead Rising). You can keep starting over with an improved character. The only problem is the NES version achieved this with long passwords. However, you save your character only, not your progress, and the game can be beat very quickly with a fresh character, so it's not too big of a deal.

River City Ransom EX is an update for the Game Boy Advance and adds new moves, the ability to recruit bosses into your gang so you can have 3 AI companions with you, more enemies on screen, and the ability to save your character to the cartridge.

Here is a video series that takes you through, and examines the game mechanics of EX:

http://www.youtube.com/playlist?list=PL8E3568B0621BA63E

The original is on thr Wii Virtual Console.

As you'll see below, lots of other games have taken RCR's mechanics.

---

Final Fight

Capcom's best beat-em-up.

A gang leader kidnap's the mayor's daughter. So the mayor, his daughter's boyfriend, and his friend team up, and walk from one end of the city to other (slums, subways, underground fightclub, red light district, downtown, high rise).

The 3 characters play very differently. Their weight, speed and impacts transcend the screen, and you can pretty much feel them thought the controller (just like in street fighter games).

Haggar is a retired pro wrestler. He moves very slow and hits very hard. He is able use wrestling style grapple moves like suplexes and a jumping piledriver. When Haggar isn't saving Metro City from the Mad Gear gang, he is piledriving sharks in internet memes. smile.png

Guy is a martial arts / lower damage speed freak. I believe he can also jump off the sides of the screen chun-li style.

Cody is the bf, and the all-rounder.

The only real downside to this game is that is was designed around the arcade mentality. You outlast the environmental hazards and waves of enmies with quarters.

Final Fight 2 & 3 were released as SNES exclusives and more of a console game design mentality. The whole series is very good. 2 & 3 are on the Wii virtual console, and part one has a great re-release on PS3 and 360 called Final Fight Double Impact. You should grab the demo.

Final Fight Double Impact


---

Streets of Rage

Streets of Rage is Sega's "me too" version of Final Fight. When Capcom brought the home version out Final Fight out as an SNES exclusive, Sega created Streets of Rage as their answer to the series. Their main character Axl looks and fights just like Final Fight's Cody. A lot of the enemies are also shamless rip offs of Final Fight enemies.

SOR 1 is not that special. It's a reactionary clone that plays well enough but would be completely forgotten if not for it's better sequel. There are some awkward design choices, like calling the characters 'ex-cops', and having their special be a police car that drives in and fires a gun at all enemies on the screen.

SOR 2 is great! The graphics are better. The controls and response are much better. The characters have more moves, and proper special moves instead of the police car. Those special moves come into play a lot when countering enemy grabs. They even added a pro wrestler character so they SOR would have a Mike Haggar equivalent. Good levels, good controls, excelent music.

A lot of people consider SOR2 to be the greatest game in the history of the genre. But it's really only the best beat em up in the Sega Genesis library. Their only frame of reference is the other mediocre and horrible games on their console.

SOR 3 is a bit of a step backwards. The level designs are attempt to be too clever for their own good, and the series took a turn towards science fiction with cyborgs, clones, and sillyness such as a playable boxing kangaroo.

However, they changed the character movement and pacing for the better. They move much quicker and have more moves. They added a double tap dash which alows for some more move setups.

dash + attack
dash + jump + attack

You can grab these all over the place, and they are worth having. PSN, XBLA, Sonic's Ultimate Genesis Collection, and Wii Virtual Console. I think Steam too. SOR2 at least is a must.

http://soronline.net/main.htm is a great fan site. They disect and analyze all 3 games. They also still host the SOR Remake game that is worth playing through. It has all the levels from all 3 games, and all the gameplay mechanics and AI from all 3 that you can mix and match at will. They also have an optional AI partner.

Sidenote: The Golden Axe games seem to be built on the same code base. They are fun games, but they don't offer anything unique worth analyzing. They are basically SOR with a sword and socery re-skin to appeal to a different market. Each game is functionally equivalent to the same numbered game in the SOR series.

---

Scott Pilgrim vs The World

This is an amazing modern 2D beat em up! It takes most of River City Ransom's gameplay mechanics, because the comic and movie are based on a guy who lives in an RCR (and other early 90s games) type world. There are also shout outs to tons of other games in here.

All the characters have their special moves and can level up. The levels are great. The controls can be stiff in some situations (can be hard to change direction while attacking), but other than that they are perfect, and the feeling of hitting people is great. The music is awesome.

The levels are connected together via a world map like in Super Mario Bros 3. You can go where you want, and replay anything as much as you want.

http://3.bp.blogspot.com/_F7V_SdrmwV0/TGRSLSyV7bI/AAAAAAAAAEY/8ffKZk_rMCE/s1600/ScottPilgrimVsTheWorld_Screenshot_Map_ToHiddenSoundStudio.bmp

There is a demo on XBLA and PSN. This is a must play, and there is DLC coming out in a few days to allow for online 4 player multiplayer.



I haven't put this down since it came out. It has become one of my favourite games of all time.

---

Konami

Konami was the king of the quick and dirty licensed beat em up. People have fond memories of these games, looking back on them with rose tinted glasses, but they don't live up to the hype. These games all use a similar codebase and just have unique assets for whatever license.

All games use a simple attack, jump, special (attack + jump) set up.

The characters are always weightless, and there is no feeling of impact when hitting something. Even when walking, they seem to just slide around the floor while moving their legs. The sound effects for swinging and connecting are always very poor and sound nothing like combat.

These games did have good graphics and level designs a lot of the time, but they were all style and no substance. They relied completely on their licenses and that you could have 4 players.

X-Men, and the Simpsons have demos on PSN and XBLA. But really, they aren't worth bothering with. TMNT The Arcade Game (TMNT 2 on NES) was probably the most enjoyable, and ha(s/d) a demo on XBLA.

Sidenote: There is a 3D UbiSoft remake of Konami's TMNT: Turtles In Time. It looks nice, but has the same unsatisfying gameplay mechanics.



---

TMNT GBA

A very high quality, modern game by Ubisoft. It has a bit in common with RCR and Scott Pilgrim. It fell under the radar, and there isn't anything unique about it worth examining, but compare the quality of the animation and the good gameplay to the 3D Turtles in Time video I posted above.



---

Yakuza

Yakuza is like a 3D version of River City Ransom. You have an open world, can visit shops and restaurants, can advance your character, and have roaming gangs that fight you all over the city. You can use items, and there are situational and environmental attacks.

These games have a meter that fills up as you damage people that you can then use to pull off an extremly brutal special attack. It can be an environmental attack, or very high damage strike with a weapon. eg: Stabbing someone in the stomach with a knife instead of just swining it. Sending a bike crashing down on someone's head. Grabbing someone by the back of the head and slamming it into a wall.

You are able to single out an enemy and taunt them. This will draw them out from the group and have them be the one to attack you.

The only problem is the nonstop, overly long, self absorbed cutscenes. At any moment you may have to watch a 30-45 minute cutscene. Which means they take a concept that can be conveyed in 30 seconds, and stretch it out to an hour, along with the famous japanese game "..." dialog taking up 90% of your time.




---

Double Dragon Series

IMO, only 2 games in this series are worth a damn.

The original early games were all flawed in ther own ways. Each port was different then the rest, and Double Dragon 3 was a complete disaster. Only the NES port of Double Dragon 2 is good, but it strays very far from the standard beat em up formula. The best thing about these old games is the opening scene of the first game's first level, which has been copied 7000 times.

Super Double Dragon was awesome. It sticks to the standard beat em up formula and doesn't try to implement different types of gameplay from other genres. People hate on it for being too easy, but it has great graphics, good controls, good combos, great weapons, good music, and really fun levels. It's highly enjoyable and replayable. Who cares if it's easy? The fighting in it feels extremely good, and it hasn't aged a day since it came out.



Double Dragon Neon has 3D character models, but plays exactly like a 2D beat em up. Everything about this game is good. The characters have persistance, can level up and learn new abilities, and the levels are on a world map like Scott Pilgrim. This game is al about of love, and an 100% quality product. I hope we get a ton more like it.

The game has a dodge button. Every time you dodge an attack, you increase your normal attack damage for short time.

You use special abilities by collecting audio cassettes that represent skill points. You make an abilities mix tape by picking 2 tapes to mix together.

There is a nice high five system which lets you do various things with your partner depending on what direction you press.

Only problem is we never got the promised multiplayer patch!

Demo is on XBLA and PSN. Along with Scott Pilgrim, this is a must play!



There is also a recent mobile remake of Double Dragon 1, but I'm reluctant to spend even 3$ on it.



---

Warriors: Street Brawl

Whoever is reponsible for this should be drug out into the street in broad daylight and executed gang style for all to see. It's bad enough that the game is bad, but it's a WARRIORS game. This should have been ___THE___ modern beat em up game.

The controls are poor and unresonsive.
The levels are nice, but they are either pitch black, or washed out in oversaturated single color lighting.
The enemies don't react very well to being hit.
The enemies have no concept of being in a group, or in a beat em up game. They surround you from all sides and strike at you with reckless abandon.
You can attack in any direction instead of just left or right. After playing hundreds of these games over 2 decades, this idea has never worked. Looks good on paper, but ruins the feel of the games.


Demo is on XBLA. Only download it to punish yourself, and get a good example of everything not to do in one of these games.


---

Summing it up / Things I've Learned / Dos & Don'ts

- Don't design with an arcade machine mentality! Have persistence, multiple characters, mutliple paths, multiple endings, etc.. etc...

- Have multiple characters, but make them all different. Have a large / strong / slow one, a small / fast / weaker one, and a medium all rounder. Having something like a large / quick / weak guy is just bad design, and breaks down communicating visually with the player. This goes for enemies and player characters.

- Support recruitng NPCs into the player's gang. Along with persistance, this allows for things like recruiting the level 1 boss, then playing an alternate level 1 with that boss later. Including possibly having a pallete swapped version of the boss as his replacement with new dialog calling him a traitor. You can also have different paths, dialog, and situations depending on who you do and don't recruit. This adds depth and replayability. Even things like having a door in an alleyway that only one guy is allowed entry to, and only if certain people aren't in the group.

- It's fun to have AI controlled allies along for the ride. Even if all they do is keep some of the enemies busy and contribute a sum total of 0 to depleting the enemie's health. Freely switching between them is also fun.

- Enemies need to be treated as a group, and not individuals! As individuals they will all just look out for their best interests, and surround and attack the player all at once. As a group they can surround the player from a distance and cheer on while one or two enemies engage. It should be entertaining to watch and to play. Like a movie fight.

- RCR has set gangs with twenty unique members each. Each member has AI traits that make him different from other members in the group. A member who fights honorably will not strike a player in the back, or a throw a weapon. A dirty fighter will will do whatever it takes, and prefer cheap shots. A coward prefers to strike in the back, will not fight one on one, and will flee if low on health, or no one else is left. etc...

- Use a simple rock / paper / scissors ruleset for the combat. A strike will stop a grab attempt. A block will stop a strike attempt. A grab will override a block. A special attack will break a combo, escape from a grab, and cannot be blocked. That's why it's special ;). No need to get more complicated. A shoot-em-up is not a fight sim, and a beat-em-up is not a UFC sim.

- Prefer shadow blobs to perfect shadows. Shadow blobs allow you to see exactly where you are positioned, and can be resized dynamically while you are in the air to communicate your height. While you can easily just draw a shifted, dynamically recoloured copy of your sprite at 25%-50% alpha, it clutters the screen, causes positioning confusion (especially while in the air), and visually conflicts with how the lighting looks in the level tileset. Perfect shadows fail in every way here.
eg: The game in these screenshots uses perfect shadows, and it's fugly and confusing.
http://www.hardcoregaming101.net/nightstorm/night.htm

- Use layers! If you just have a single layered backdrop behind the characters, it looks like exactly that. A cheap, lifeliss cardboard cut out world. The up close game should have 3 layers. The action is on the middle in front of a main background layer. Then there is a foreground layer on top the playfeild.
eg:
http://2.bp.blogspot.com/-d20vlp_h8B8/T6uuOkQosiI/AAAAAAAAAvY/SJ53iHqBVEM/s1600/streets-of-rage-2_2s.jpg
http://3.bp.blogspot.com/-d2tXMWREWHc/TvFeHH4KA7I/AAAAAAAACD8/on1EHrfidYc/s1600/streets-of-rage-3-genesis-dr-zan.jpg
http://2.bp.blogspot.com/_qUKzPjLgX8Y/Ru67IT6UkKI/AAAAAAAAAto/hQXh82deyvg/s400/77.jpg

The foreground layer needs to complement the playfield and not obscure it! Keep tall objects thin, and long ones transparent enough.

Behind this you have your distant objects layers. The sky, and then possible distant buildings, clouds, or whatever makes sense.

The playfeild and close background need to scroll together in tune with the player. The foreground should scroll differently to give the illusion of depth. Also the distant background layers should all scroll differently.

If you do that properly, you will have the illusion of a living environment. You can also have objects like cars, trains, birds etc scrolling through the backround layers.


- How do you simulate weight and impact and make the player actually feel it? Focus on holding the key poses. Observe this screenshot of Axl from SOR: If Axl doesn't connect, his arm snaps right back into his idle pose. When Axl connects the impact frame is held, there is an impact sprite overlaid (whch also closes any visible gap between the fist and the enemy), and then the enemy plays the animation of getting hit in the chin. The last/key frame on the enemy is held for the duration of the knockback period. The impact sound should also last exactly that long.
http://2.bp.blogspot.com/-d20vlp_h8B8/T6uuOkQosiI/AAAAAAAAAvY/SJ53iHqBVEM/s1600/streets-of-rage-2_2s.jpg
If you can implement that, you're already ahead of every b-grade beat em up every released.

- Don't go crazy wih your health pick-ups. The best games have exactly 3. Small, medium, and large. It's important to comminicate their value through their size and shape. Typically, the large item (a turkey or roast beef) will refill your health to full and timing it's use becomes important. It is often left on the ground and not consumed until the last possible second, making it double as an extra life. Or if the health bar is full, it instead awards a huge amount of score points. You can have more variety by changing their look to suit the theme of the level, but keep the same sizes and shapes (eg, small round, medium pyramid, large spherical). If the user has to guess, or it's not 100% obvious which is which, you've failed them.

- Same goes for weapons. The small weapon (knife / knucks) that gives a little extra damage and no extra range, the medium (bat) which gives extra damage and a little extra range, and the long range (steel pipe / sword / bo) that is good for long range crowd control. Especially if you can line a bunch up and take them out in one swing.


#5028282 How to avoid slow loading problem in games

Posted by MrDaaark on 03 February 2013 - 02:27 AM

cr88192, this is all complete nonsense. Please don't get defensive. Instead of trying to be "right", learn from your mistakes and become better at your craft.

HDD space is a near infinite resource these days, and this thread is about in-game loading times. No one is going to miss the few extra bytes a DDS may use over another format.

Every optimization has a drawback. You always use more of something else to achieve your goal of using less of whatever the bottleneck is.

Just like mipmaps take up 33% more space per texture. It's not that expensive, and it solves the problem very well.

We used to use more memory to create look up tables to avoid expensive computations. Now we often do computations over again to avoid cache look-up misses.

Disc based games often game data in ways that a whole section can be streamed in at once, instead of storing it in a way that takes up less disc space. It doesn't hurt anything to use up all the space, and the loading times can improve dramatically.

GPUs are built to use DDS textures. They are supported "as is", both to save space, and to improve efficiency when they are being passed around. You get quicker texture loading (remember, this is a quicker loading thread!), less VRAM usage, and better bandwidth usage all for free.

power-of-2 is good, but mandating power of 2 isn't always itself optimal from a content-creation POV. better IMO to accept whatever, and resample it as needed, but generally as a matter of policy try to keep everything power-of-2 (to avoid resampling).

Every piece of art ever created had restrictions on it's dimensions. Be it 512x512, 8.5x11 (A1 legal), the size of a poster board, the size of a wall in a cave, etc... If size of 2 doesn't fit the object to be textured, then you work on it in whatever dimensions you want WITHIN a power of 2 canvas.

The art can be whatever dimensions it wants. The canvas MUST be power of 2.

a lot of the ugliness caused by resampling can be reduced by using bicubic interpolation for the texture resampler, but granted, doing this is slow (somewhat slower than bilinear or nearest interpolation).

Changing the aspect ratio of an image destroys it in many ways. The dimensions of a piece, which are very important to establish it's look and feel become distorted. Wide things become thin, thin things become wide, curves get straightened out, or go from being short, to long and vise-versa. This isn't a programming issue, so you can't program your way out of it. It doesn't matter what filter or technique you use. Changing the aspect ratio of an image completely changes it.


#5028269 Mario Gameplay Analysis Video

Posted by MrDaaark on 03 February 2013 - 01:38 AM

I've subscribed hoping that you do more of these. smile.png


#5028188 Mario Gameplay Analysis Video

Posted by MrDaaark on 02 February 2013 - 05:55 PM

We don't have enough of this stuff here.


#5028171 How to avoid slow loading problem in games

Posted by MrDaaark on 02 February 2013 - 03:51 PM

good loading times are hard.
 
for example, in my case (on a PC), loading textures is a good part of the startup time, and a lot of this due to resampling the (generally small) number of non-power-of-2 textures to be power-of-2 sizes. this is then followed by the inner loops for doing the inverse-filtering for PNG files (more so, the cycle-eating evilness of the Paeth filter, which wouldn't be as bad, except that this tends to be one of the most generally effective, and thus most-used, filters in PNG).
 
I sometimes also wish that PNG also had a simpler "A+B-C" linear filter, which can often compete well with Paeth, but, more notably, is much cheaper (it could improve performance by potentially dilluting the number of times the encoder picks the Paeth filter). granted, along similar lines, one can also wish that PNG filtered per-block rather than per-scanline, ... but alas. (nevermind all the pros and cons of using custom image formats for textures...).
 
note that even as such, decoding such a texture may still be faster than loading a simpler uncompressed texture would be (such as BMP or TGA), due mostly to the time it requires to read files from the HDD.
 
luckily, one can usually cache textures.
unluckily, you still have to load them the first time they are seen.

Why would you have any data in non optimal dimensions, and why would you even bother loading any of those formats? This stuff should be done once, and only once. Write a tool that goes over your assets folder and does any needed conversions.

Take all your files, and convert them to proper resolution (better yet, beat your artist with a blunt object until he makes proper power of 2 images. Images look bad when you change their aspect ratio), and then turn them into compressed DDS files. You're writing a game, not an image editor, it doesn't need to know about PNG or TGA or anything else.

Then when your game runs, dump your compressed DDS directly into VRAM. You don't need to check their dimensions. You don't need to uncompress or convert anything. Just dump it directly. DDS also handles mip levels, which covers your next paragraph.

When the game is running, everything should already be ready to go. Nothing should ever have to be converted or processed on the fly. Keep a good copy of everything for editing purposes, but make sure it's all converted when you build your game. Do a simple date comparison, if any asset is newer than the last converted one, convert it then.


#5027973 I want your opinions on Mobile controls and general game play.

Posted by MrDaaark on 01 February 2013 - 05:09 PM

Fixed pads are horrible. For one, they don't scale well most of the time. And secondly, they don't work like people seem to imagine them working in their heads. There is no tactile feedback, and when you use a real d-pad you thumb is always touching it. You have to press it to actually get it to do something.

When it's on a screen you have to move your thumb away from the screen and then back again. You tend to miss. Or forget to lift your thumb up. And the bezel around the actual screen varies between devices. It's almost not there on a cell phone, but it's an inch or more on large tablets, making it very hard to actually get your thumb in there in the first place. On screen d-pads fail in every possible way.

You should look to Final Fantasy 3 for good dungeon crawler controls. You move with a onscreen joystick that is relative to wherever your thumb is. If you are standing next to something that can be interacted with, like a NPC or a chest, then tapping the screen anywhere will use it. Once in battle, it's menu based.

Works flawlessly.

And as L.Spiro said, it will quicksave when I need to shut it down. smile.png

I've played games that use random swipes, like that gladiator one, and they are complete trash. Yes it's a new idea, but not every idea is a good one.

You can also look at Cardinal Quest for more real time controls, but it functions like a Rogue-like.


#5027956 program for animating 2d sprites (from 3d models?)

Posted by MrDaaark on 01 February 2013 - 04:04 PM

Fragmotion can do this out of the box.

Blender can do this to, but you'd need a script to control the exaxt camera and poses, and then you'd have to assemble them yourself.


#5027272 Creating a map editor like Warcraft 3

Posted by MrDaaark on 30 January 2013 - 01:21 PM

1) Put all your tiles on a bigger sheet, and remember where they are, so you can figure out what their coordinates are. Bascially you should have a list that has every material, and what coords it was assigned on the sheet.

2) Make a data structure that consists of 4000 quads (or however many you need for you map, I'm using 4000 because you said 4000). GO find a tutorial somewhere that will tell you how to make one, or use a modeling application. Remember that each quad will need it's own set of uv coords. They can't be shared.
struct quad
{
   vector3 [4] vertex;
   vector2 [4] uv;
}
3) Go through the quads and assign them the uv coords from your texture atlas. Refer to the list from step one.

4) Use XNA to create a vertex object out of your data from your struct.

5) When drawing, load the tiles texture atlas, and then just draw your map out in 1 call, as one model.

Drawing your map til by tile means you are sending over 4000 draw calls per frame. That's about ~3500 too many!




PARTNERS