|
Post by andymc on Apr 15, 2016 13:48:23 GMT 1
Current PC screenshots from 15 year old version: The original game was written by myself in 2001 and was due to be published by Kooldog games in 2002, however thie never happened and the source code was lost soon after when I moved house and lost my CD backups. I have recently recovered this game source code thanks to an old employeee of the publisher and intend to re-write it for release on Android. I will use B4A and LibGDX to write the game and will borrow some features I like in the game Tiny Troopers which is similar to the design for mine in many ways. Keep an eye on my website: coffeeinduced.wordpress.com for more details as well as looking here for worklog entries.
|
|
|
Post by andymc on Apr 18, 2016 9:31:44 GMT 1
Okay, time for a quick update on the early work on this PC to Android conversion. I've written a task list as shown below to follow in order to convert my game. I've tried to make each task achievable in a small amount of time, anything from 30 minutes to a few hours. I'll generally try to work down the list until the game is complete. The list will change over time and I'll update it here when it does. convert all graphics to png or left as jpg - done add transparency to all graphics - done check all sounds are mp3 or ogg (check online) - converted to OGG - done redesign control system, write design doc - done generate 500 name list - done create all types required in b4a - done test loadmission code on b4a - done draw level on b4a - 50% done scroll around map on b4a add simple movement code using screen taps add enemy movement add fire code add grenade / rocket dragging add enemy AI add enemy bullets add collision detection add map collision detection look at route finding using a* code add prisoners add crate pickup code create database for storing names and soldier details As you can see, I've already completed the first few items on the list. The PC game was written using Blitz Basic which didn't support 2D transparency in sprites and needed a set colour to use to blank out as a background colour. Here's what I mean: the PC image has a white background which BlitzBasic was told to treat as totally transparent and the shadow itself is not see through. after updating the image using Paint.Net I remove the white background and half the transparency level of the blak image, when drawn as a texture using LibGDX this will give a much better looking shadow allowing for the grass or other ground features to show through. The other changes to graphics have been removing graphics that won't be required in the Android version, like custom mouse pointers, some of the animated menu items and also converting everything from BMP to PNG format. The theme tune has been converted from MOD format to MP3 using a free online tool I found on Google. Regarding the control design, the PC version required you to hold down G then click to throw a Grenade, R to fire a rocket, or T to call in an airstrike. Obviously I can't do this for the Android version, so I'm going to copy the methods used by the game Tiny Troopers, and use the method of having a grenade icon which you can press then drag to the target to fire a grenade or rocket. for airstrikes I'm toying with the idea of using a minimap to call in a strike, as done in Call of Duty on PC, if this doesn't work then I'll use the same drag method. One feature I love in Cannon Fodder is that every soldier has a different name, my PC game didn't have this but I'm going to add it to this game, I've used an online name generator to make a list of 500 unique names, I use Excel to remove any duplicates. When Cannon fodder was made, the first soldiers on the list were named after the developers, so let me know if you want to be on the list! When each soldier dies, he'll be given a grave in a graveyard and the player will be able to press any of these graves to see who it is and how they died. I'll use a SQL database for storing this. I'll leave it there for now, I'll do another update when I've completed some more points, feel free to comment and like this post if you want me to continue.
|
|
|
Post by andymc on Apr 19, 2016 9:13:22 GMT 1
Looking through old code.....
Wow! I wish I'd put more comments in back in 2002 when I wrote this game! There's over 4000 lines of code in total and it's taking me a while to work through it all. Some things I thought I'd put in I didn't, and then there's somethings I'd done that I'd completely forgotten about.
I can already see things I can do to improve the performance, like not drawing every single object, without checking if it's on screen or not. the game currently stores all objects seperately, so to draw the map on screen it has to cycle through each object type in turn drawing them out, what I'd like to do instead is have an array for the map, then store each object on the map, what I could do then is just cycle through the array for the area aroudn teh player and just draw what's required, this would be much more efficient. I won't have everything pixel perfect, maybe five by five pixels per square on the map, meaning for a screen of 1280x720 for a phone screen, the map array would be 1280/4x720/4=320*180 = 57600 cells to cycle through per frame, this should be fine, and should be more efficient than the current method, this also allows for any map size, whcih currently is set at 2000 by 2000, if I use a 1/4 map size for the array, thena map size of 10 screens across by five screens down would be 3200x900=2880000 cells for the whole map, which is just under 3 mb of memory if each cell is one byte in size, I think this should work well. the when drawing the map the game would just work through the block of cells the player can actually see to save processing power. Most maps will be well under ten by five screens so this should be fine.
Sorry for that, just thinking out loud to myself. Wait until I get onto A* path finding, I'd watched some youtube videos on that and it's going to be tricky.
|
|
|
Post by andymc on Apr 20, 2016 8:13:49 GMT 1
Here's a gameplay video of the original game as it was back in 2002 on the PC.
|
|
|
Post by wonder on Apr 20, 2016 12:51:01 GMT 1
It looks so cool! I'm sure the new version will be fantastic!!
|
|
|
Post by andymc on Apr 22, 2016 9:33:44 GMT 1
Okay, so all the existing types have been converted from blitzbasic to B4A, so we now have types for player soldiers, enemy soldiers, grenade, bullets, etc....
I've also made a skeleton B4A file to hold the new types, right now it just loads the company logo onto the screen and that's it. The next step is to load all the grahics into textureregions, then try loading a level into type objects and display a level on screen. I might change how levels are saved, but the first stage of the project is to make it work the same as the PC version then improve it from there.
|
|
|
Post by andymc on Apr 27, 2016 8:53:57 GMT 1
level loading nightmare!
I'm trying to load a level using a level file from the PC blitzbasic version of the game into B4A. I'm using the randomaccessfile library and am having some issues. First it couldn't find the file, then I realised I had to copy the file from the dirassets to the dirinternal folder, but now I have bigger problems. The first integer value in the file is the number of trees on a level, blitzbasic says it uses 2 bytes amounts for int values, which is great, as the randomaccessfile library does too, except this doesn't seem to be working. The number of trees b4a is reporting that it's finding is 1073741824, which is slightly higher than the 50 or 60 I was expecting. So then the next stage of level loading is to carry on and load the position of these trees, each one stores the x value then the y value of the coordinate in the file, these values are also all read in as garbage until the file runs out and I get a bufferunderrun exception.
No idea what to do now, except maybe just accept that I can't use my old level files and will have to manually recreate all the levels using a new level editor I'll to code using b4J which I was hoping not to do.
|
|
|
Post by wonder on Apr 27, 2016 9:13:21 GMT 1
|
|
|
Post by andymc on Apr 27, 2016 9:37:09 GMT 1
Fixed it! You were right I think wonder, also, I had to open the file using littleendian type (whatever that means, will have to google it), but anyway, it's solved now so my next step when I have the time will be to load the entire level and display it on screen. I now have a nice little mini map showing on my Android device showing all the trees on the first levels of grenade, and it matches the PC version exactly! This feels amazing! My plan will actually work! Thank you so much Erel for responding to my question on the official forum so quickly. It might not look like much below, but each tree is in the right position for level 1 of Grenade! The next screenshot will show all the other level objects drawn correctly using the right graphics. Expect this in the next few days, probably Friday morning.
|
|
|
Post by wonder on Apr 27, 2016 10:47:17 GMT 1
Good!! I'm looking forward to see some screenshots / videos!
|
|
|
Post by andymc on Apr 27, 2016 10:52:40 GMT 1
thanks Wonder, right now it will just be a straight copy of the PC version, but once I'm happy it runs smoothly on older android phones I'll add in a few extras and improve the graphics and gameplay. I think I'll need a week to get the levels completely loading in and dsiplaying properly, then I will put in the players and enemies. Most of the work involves copying and pasting the code from Blitzbasic into B4A and then going through line by line converting the code to B4A.
|
|
|
Post by andymc on Apr 27, 2016 14:42:06 GMT 1
Quick lunchtime update screenshot:
|
|
|
Post by wonder on Apr 27, 2016 21:56:37 GMT 1
Really nice, Andy! I see you're making some really good progress! Tell me, are the shadows sprites themselves or are they calculated from the tree model? Are the trees 3D models or 2D sprites?
|
|
|
Post by andymc on Apr 28, 2016 9:29:10 GMT 1
It's all 2D, the shadows were hand drawn by myself in MS Paint. the objects are all prerendered using 3D Studio Max and then saved as PNG images. I draw the floor, then all the shadows, then draw the objects in a set order to give the impression of depth. I will be using sprite scaling later on to make objects appear to fly into the air, and use shadow blobs under them to give the impression of height. It's all classic 2D game engine tricks form the 90s I'm using. But I grew up playing old Amstrad and Amiga games so I love this sort of thing. It also means the game should run run on older phones/tablets.
can the LibGDX library on B4A handle 3D yet? I know the full LibGDX framework can, but I've not seen any B4A users talking about it.
|
|
|
Post by andymc on Apr 29, 2016 8:23:39 GMT 1
Another update. I've almost completed the code to load in everything from the PC level files and also have been working on the display code to draw out the level, the results is below: I am able to scroll around the level by dragging my finger around the screen. There's no enemy soldiers yet (although they are loaded from the map file already) and there's also nothing moving.
|
|