Android 2D Game Development: How to handle the background/rendering in general? - android

I'm currently trying to create a 2D Android based game for my Android App Dev. class, and after making the layouts and finishing up everything else, I realized that I don't have a clue as to how to render the images and how to have a scrolling background for my game.
The Idea:
It will be a very simple 2D game
kirby will be the main character (kinda already understand how to animate images)
2 enemies (wanted them to walk. but since project is due in 4 days, they can stand)
kirby can only move left/right and jump (which i will figure out later haha)
-
The Research
-
I have looked for around 5~6hrs for the last couple of days and cant figure it out
The main problem I am having is that I understand that Canvas/OpenGL is used to make the background and render Images but I cant find any videos or easier tutorials on making the level scroll as I want it too or the code.(if you dont know what kirby is, the level scrolls similar to mario style, kirby xpos + = level xpos + is what I think the code would be like...)
Yes I know that this is sort of waiting to the last minute, but any help would be much appreciated !
Thanks Again,
Gabe

Related

How can i change the entire speed (timing) of a android game made with cocos2dx?

i'm making reverse engineering on a android game made with cocos2dx library, editing the .so file (libcocos2dcpp.so) with ida pro and a hex editor. i've getting success changing small things, like swapping buttons functions (changing the jump addresses).
I think this game action too slow, there is someway to increase the speed to entire game? like changing some lib variable and make it accelerate 2x. i think it can be done decreasing a especific delay or increasing the clock cycles, or even changing some fps parameter.
i've readed the documentation of cocos2d and see found some relative functions like getDeltaTime, SetAnimationInterval, CCDirector, CCSpeed, CCAnimation, setTimeScale, etc. but its too many to find the right one trying by trial and error.
Can anyone help me? i will be very thankful

How to design a algorithm for bigger Tic Tac Toe game boards?

I have created a tactactoe game in Android and it is great. But this game has 3*3 game play. In 3*3 game we can implement our manual AI(Filling corner position first) or we can use Minimax algorithm to get best move. This is great for 3*3 board. But when I tried the same algorithm for 4*4 and 5*5 the algorithm is taking a huge time to determine the best move.
Hence I can not use minimax algorithm.
So what can I do now? I want to implement different level with different goal like below
Here it is 6*6 board and the goal(Consecutive symbol to win) is 5. So I want to design an ai for this dynamic board with dynamic goal.Goal can be 3,4,5 etc. How can I do that?
Thanks in advance.
ohh boy.. I'd rather use strategies instead of actual AI paradigms on this type of game. Make a hardcore strategy, and then for lower levels of difficulty make it dumb with random moves with a p probability.
Basically your strategy is what any 5 year old would do: if the opponent is 1 or 2 steps* away from making a full line, block him. else, work on expanding one of your longest lines.
1 step, if his line is closed on the other end, 2 steps if his line is open on both ends.
Of course, you might trick this strategy if you're given the opportunity to make a cross, or develop 2 lines simultaneously. But you can make a program to watch out for that too.
But if you really want to go the AI route, why not try a genetic algorithm that saves and cumulates its results (best individuals) after each game? if calibrated correctly it will run pretty fast and then all you have to do is train it like a dog a couple of rounds.

Rolling a dice, with a dice :)

I currently need some advice about a "simple" issue.
I'm building a game helper, where users may roll dices (6 faced dice, 20 faced dice, etc). Actually, I displaying only the number to the user.
But, to make that much better to use, i want to display THE dice on the screen (on an alert dialog with custom layout for example).
My problem is here, and I don't really know how achieve that. I can't believe that the only way is to create each face of the dice to display it.
For your information, I need theses dices : 6 faced, 8 faced, 12, 20 and special 6 faced. :) That will be a very long task if I have to create all dices :(
The best i can dream, is to have the dice animation, but i guess is a bit too complex for me at this time.
Anyone as some advice about it ?
Best Quality / Highest Effort:
If you want to show a 3-D tumbling die, you probably want to look into the free 3D modeling/rendering/simulation packages. Blender is the first that comes to mind, although there are probably easier free alternatives. They take some time to learn, but you can model a photo-realistic 3D solid and then animate them in real physical simulations.
Going that route, you'd render short (GIF?) animations for each. Then you just have to look up how to display an animated GIF in a dialog (there's plenty of examples available).
Lower Quality / Less Effort
You could just display a single, 2D face of the die being rolled on your dialog, with a number (or pattern of dots) in the center. Depending upon the type of die, the 2D outline of the face could be a square, triangle, pentagon, etc.
The drawing logic for this would be fairly trivial (again, many examples available online). You could even do a crude animation, by having it cycle through several values before stopping on one. Have the cycling rapid at the start and slow at the end, and add a little 'click' sound for each, and you'd have something users would probably like.

Real Time Multiplayer Best way for pushing updates on android

I'm currently developing a Real-Time Multiplayer top down shooter.
The Multiplayer is "working" and I'm currently struggling with pushing the player updates such as position and fired shots.
My first try was using the service "appWarp" which worked perfectly but isn't free and only provided around 2 Million Messages in the free version which i completely filled in around 2 weeks with only 2 devices and 2 players. ( Maybe way to much updates send )
Then I implemented Google Play Game Services and tried using this to send the updates:
I'm able to use "sendUnreliableMessage" for Position updates, which works faster than appWarp used to. I use interpolation to get over the package loss issue here which works alright.
But here the problem is with firing shots. The nature of UnreliableMessages is that packages can get lost, which happens a lot. Shooting 4 times only makes around 1 or 2 of them appear on the other device. Which means that 2 packages are getting lost. Using "sendRealiableMessage" i can achieve around 2-3 packages getting through but with, of course a higher latency. Which makes the shots appear after around 1 second on the other device.
For a fast paced real time multiplayer game this is not what i wanted to achieve.
So what is a better way to do this ? I found web based solutions like socket.io but don't really know which fits the best for my needs.
I found this website which contains a big list of every web based solution for this problem but don't really know where to start.
https://www.leggetter.co.uk/real-time-web-technologies-guide/#_hosted-realtime-services
I am really really thankful if someone could help me with this problem!.
Since you're asking for opinion, I can suggest you try Multiplayer in Unity. It is the leading game engine as of today, so you can expect a huge support from a stupendous user-base.
Another option would be Photon. Hope these suggestions helps.

as3: better way to render many objects with png-sequences?

so I'm working on a game for mobile using AirForAndroid as3. In the game I need to have a lot of enemies at once on the screen (up to 15 would do I assume). These enemies are atm movieclips and contain various movieclips within, such as shapes that work as hitareas which are vital to the games functionality. The enemy-movieclip also contains a png sequence (a walk loop). Right now this seems to be veeeery unefficient for mobile devices, since 4 or 5 enemies at once already makes the game extremely slow on my galaxyS3.
So the question is, is there a diffrent approach to "render" the enemies, to make the display process less "expensive" ... I can't really get around the png sequence itself, which will span to maybe 200 pics combined, walk, run, fight animations and so on. If anybody has an idea or knows a trick or can put me towards a better solution, that would be awesome.
thanks for reading,
ANB_Seth
The MovieClip is very expensive (memory consumption and CPU/GPU performance) object. Especially on mobile devices. I recommend you to give up using MovieClips at all.
There is standard game-dev technique to make animation: Spritesheet animation.
Some links: Tutorial, Performance comparison: MovieClip vs Spritesheet, Descriptions of the main idea and implementation

Categories

Resources