XNA 4.0 Animation Ideas for Windows Phone - windows-phone-7

I am working on a game and I need to have two characters talking to eachother. I know that XNA does not allow me to play a movie other than fullscreen so I need to actually "play" the animation inside my game app in a different manner. The characters have animated environments around them so the animations are not simple head movements and as such, animating the characters via keyframing in a 3d model is not an option. The dialogue between the two characters is a cut-scene between levels, so it is not part of the gameplay itself.
I am not sure what the best approach to this would be so if you have any ideas, please let me know.
This is what I thought of so far:
1. Create all the individual frames for the characters as images. Load these images in a spritesheet and go through each frame at my desired framerate.
The problem with this approach is that the maximum spritesheet texture of 2048x2048 would not allow for too many frames as the characters are something around 300x200. The other problem is that I have two characters so, the minimum scenario would require me to create in memory two 2048x2048 spritesheets... and I'd like to keep the memory requirements low.
2. Load a batch of frames (images), play them, then de-allocate them and load the next set. I know that in general it is not a good idea to load lots of small textures and switch between them in drawing calls (performance wise) but it seems as though I have no other choice in this case.
I am afraid that unloading stuff from memory and loading other stuff in while in the Update-Draw loop would slow down the entire scene... so not sure if this is a sane approach.
The other idea is to make an mp4/wmv with the whole thing [char animation, subtitles of the dialogue, etc] but the interface that hosts these characters would not be as "smooth" as when rendered directly, etc...
Thank you for all your suggestions,
Marius
EDIT 1:
I have tested scenario number 2 and it seems that the performance is OK.

I have used scenario 2. It works for my particular case but I am sure it won't work for all cases.

Related

Unity - How to get started working on a large terrain/map?

I want to begin working on a big sandbox game with lots of oceans and islands. This will obviously require a very big map.
I've spent the last couple days researching the best methods on doing this and so far have figured out that
I need to split the terrain into tiles/chunks.
I need to have the player only load those tiles/chunks that are closest to them and unload those further away.
That being said. I would rather avoid flooding my game with a bunch of assets and want to kind of handle things on my own and hard code these systems in myself.
Some questions,
Can I just create a massive 20k x 20k terrain using Unity's built in terrain editing system and then worry about splicing and loading/unloading the tiles later?
or do I need to build my big terrain in an alternative program and import my terrain in then handle the splicing and loading situation?
Also, when it comes to multiplayer. I assume I would just need to basically do the same thing just for each client?
I would appreciate any other tips or guidance on doing this as well. Thanks.
Splitting into multiple chunks but ones that arent too small seems to be the better option, maybe like 4 quarters, that way you are not flooding with assets, you would disable all quarters except the one the player is in.
The problem with making a big terrain is, while you could get a tool from the asset store to split ur terrain later, you will get into the headache of resolutions and sizes and overall I guess its better to split it into 4 pieces or a bit.
You would have a trigger point where you want the game to load the terrain, and depending on which trigger point the player entered you would load the corresponding terrain piece.
For multiplayer, you would do the same thing for each client, making your big terrain as 4 smaller terrains and then loading the corresponding quarter. Tell me if I missed something.

Three.js How to increase canvas-text texture quality

What parameters, modes, tricks, etc can be applied to get sharpness for texts ?
I'm going to draw a lot so I cant use 3d text.
I'm using canvas to write the text and some symbols. I'm creating somethinbg like label information.
Thanks
This is no simple matter since you'll run into memory issues with 100k "font textures". Since you want 100k text elements you'll have several difficulties to manage. I had a similar problem too once and tossed together a few techniques in order to make it work. Simply put you need some sort of LOD ("Level of Detail") to make that work. That setup might look like following:
A THREE.ParticleSystem built up with BufferGeometry where every position is one text-position
One "highres" TextureAtlas with 256 images on it which you allocate dynamically with those images that are around you (4096px x 4096px with 256x256px images)
At least one "lowres" TextureAtlas where you have 16x16px images. You prepare that one beforehand. Same size like previous, but there you have all preview images of your text and every image is 16x16px in size.
A kdtree data structure to use a nearestneighbour algorithm with to figure out which positions are near the camera (alike http://threejs.org/examples/#webgl_nearestneighbour)
The sub-imaging module to continually replace highres textures with directly on the GPU: https://github.com/mrdoob/three.js/pull/4661
An index for every position to tell it which position on the TextureAtlas it should use for display
You see where I'm going. Here's some docs on my experiences:
The Stackoverflow post: Display many thousand images in three.js
The blog where I (begun) to explain what I was doing: http://blogs.fhnw.ch/threejs/
This way it will take quite some time until you have satisfying results. The only way to make this simpler is to get rid of the 16x16px preview images. But I wouldn't recommend that... Or of course something depending on your setup. Maybe you have levels? towns? Or any other structure where it would make sense to only display a portion of these texts? That might be worth a though before tackling the big thing.
If you plan to really work on this and make this happen the way I described I can help you with some already existing code and further explanations. Just tell me where you're heading :)

Adjusting hard values in processing for any screen size

So I'm making a game with my group on processing for a project and we all have different computers. The problem is we built the game on one computer, however at this point we have realized the the (1200,800) size we used does not work on our professors computer. Unfortunately we have hard coded thousands of values to fit on this resolution. Is there any way to make it fit on all computers?
From my own research I found you can use screen.width and screen.height in order to get the size of the screen, I set the game window to about half the screen size. However all the images I had loaded for background and stuff are 1200x800 So I am unsure how to go about modifying ALL of my pictures (backgrounds), and hard values.
Is there anyway to fix this without having to go manually change the 1000's of hard values? (Yes I am fully aware how bad it is I hard coded the numbers).
Any help would be greatly appreciated. As mentioned in title, the language is processing.
As I'm sure you have learned your lesson about hard-coding numbers, I won't say anything about it :)
You may have heard of embedding a processing PApplet inside a traditional java JFrame or similar. If you are okay with scaling the image that your PApplet draws (ie it draws it at the resolution that you've coded, and then the resulting image is scaled up or down to match the screen), then you could embed your papplet in a frame, capture the papplet's output to an image, scale the image, then draw it to the screen. A quick googling yielded this SO question. It may make your game look funny if the resolutions are too different, but this is a quick and dirty way. It's possible that you'll want to have this done in a separate thread, as suggested here.
Having said that, I do not recommend it. One of the best thing (IMO) of Processing is not having to mess directly with AWT/Swing. It's also a messy kludge and the "right thing to do" is just to go back and change the hard-coded numbers to variables. For your images, you can use PImage's resize(). You say your code is several hundred lines long, but in reality that isn't a huge amount-- the best thing to do is just to suck it up and be unhappy for a few hours. Good luck!

Effect like auto-cast spell icon in war3 for cocos2d

I would like to implement the effect that a short line segment revolving around a square (not knowing the exact effect name, it's just like the one in war3 to indicate auto-cast spell or in fishingjoy to indicate equipped weapon). Any advise/hint is welcomed. Thanks!
You have several variants. The first one, the easiest, to create frame animation of desired effect and run it on the empty CCSprite instance, that will be placed over your weapon icon. I think, 5 or 6 frames of animation will be enough. Big plus - you can create any desired effects on these frames in photoshop, and it is easy to add existing frames as animation to your project. Minus - it will take additional place in your texture cache, spriteframe cache and it will increase the size of your app. This is the good solution, if your square is quite small, because if your square will have large contentSize, it will take a lot of useless memory. For example, 6 frames of such animation with the size of screen( 640x960 pixels on retina screen ) wil take additional 16Mb of your memory.
The second variant, IMHO, much more interesting)) And it can help to save memory) This variant is to implement this animation with OpenGL) But it seems to be much more complicated)

Clean image rendering in flash player

Ladies/ Gentlemen
We are building a flash based product where we need to create icons for various modules. we are having challenges in look and feel of the icons- what looks really good on Adobe Illustrator/ Photoshop looks jagged on flashPlayer. A challenge we have is that the overall screen aspect ratio and hence aspect for the icons which are relatively sized can change
we were told in discussions with some adobe folks that
a) we need to build icons which are square, and in multiples of 32 pixels.
b) use a png format
As per them, this way the pixelation is reduced and diagonal lines won't appear jagged- we still have an issue on rendering in flash player
Any ideas/ guidance on how to approach this?
6 hours and no answer?
Here's the magical property you want: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Bitmap.html#smoothing
Just make that true, either via the setter, or via the constructor.

Resources