11 February 2016, 13:49 | #1 |
Registered User
Join Date: Apr 2012
Location: Cardiff
Posts: 407
|
My game projects in C/C++ and GameSmith
I've been trying to get into Amiga game programming for a while. I wanted to skip BASIC and go straight into C/C++ and I've finally settled on an environment I'm comfortable with:
Cubic IDE SAS\C 6.58 GameSmith Development System I'm starting this thread as a bit of motivation to keep going, to ask some newbie C questions and give a little bit of publicity to GameSmith. My first project is inspired by a Spectrum game called Microbot. It's an original and addictive little game that I enjoyed as a kid, but flawed in the execution so didn't even review that strongly at the time. Heres's a screeshot of the Spectrum version: Here's a little video of my early attempts with the Amiga version. I hope people like it so far, even though it's obviously quite basic. [ Show youtube player ] And for the hell of it, here's a original mock-up I made in PPaint. The background, particularly the floor area will get more work once I change over to a tile-based background. |
11 February 2016, 14:05 | #2 |
Puttymoon inhabitant
|
Wow!!!
|
11 February 2016, 15:58 | #3 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,356
|
It's inspiring to see that someone's taken up Gamesmith, which seems to have been largely forgotten.
|
11 February 2016, 18:11 | #4 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 722
|
Nice! Keep coding!
|
11 February 2016, 19:30 | #5 |
Jackie Chan
Join Date: Mar 2012
Location: Ireland
Age: 46
Posts: 1,001
|
Looks nice. The robot sprite could do with more detail and colour imo. I like the background.
|
11 February 2016, 20:01 | #6 |
Registered User
Join Date: Apr 2012
Location: Cardiff
Posts: 407
|
Thanks for the positive words, everyone - that means a lot!
The robot will definitely get a bit more work as time goes on - especially the back as I've literally just taken the front and blanked out the details! My first newbie question is this: SAS\C 6.58 apparently does C++. Do I have to do something to enable it? If anyone knows how to do it in Cubic IDE, even better. |
11 February 2016, 20:09 | #7 |
Registered User
Join Date: May 2010
Location: Helsinki, Finland
Posts: 1,341
|
I don't know how to enable it, but my instinct says that you should steer away from C++ when dealing with such an old compiler (and system ). Especially considering your application is a game and performance is/will be important.
|
11 February 2016, 20:55 | #8 |
Amiga Tomcat
Join Date: Sep 2007
Location: Boston Lincs
Posts: 1,502
|
@clebin
I've been messing with Gamesmith for a while. I created a brain teaser but If you complete the puzzle it Gurus. Which is funny really because if you fail or select the Demo mode it's fine I'm about to embark on an overhead game when I get chance to do some more coding. |
11 February 2016, 21:35 | #9 | |
Banned
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
|
Quote:
https://www.warped.com/amiga/ The C++ support was limited and would be considered old if not ancient by today's standards. It did add some support for little conveniences like C++ comments which is nice considering that SAS/C predates modern C standards like C99. I doubt you will find many C++ programmers who are satisfied with the Amiga SAS/C C++ level of C++ support and bugs. Even the Amiga SAS/C C support seems primitive and non-standardized although it is a good ANSI C compiler and a professional product for its day. If you need modern C++ support on the Amiga, GCC is about the only choice. If you need more modern C support then vbcc is easier to install and use on the Amiga. Both require significantly higher specs than SAS/C though. Good advice. The Amiga was created for C which generates more efficient code. |
|
12 February 2016, 00:18 | #10 |
AmigaMan
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 763
|
I was thinking in use gamesmith, game master system or similar.
Would you think gamesmith is a good start? Good work mate! |
12 February 2016, 10:50 | #11 |
Registered User
Join Date: Apr 2012
Location: Cardiff
Posts: 407
|
@ajk, matthey
Thanks for the advice. C++ is a nice-to-have but not essential. I'd like the game to run on a stock OCS/ECS machine if possible. I'll just have to get out of my OOP way of thinking... @tolkien Thanks! I can't speak for Game Master System but I recommend trying out GameSmith. It took me a little while longer to get up and running than Blitz - which I also tried - but I quickly felt more comfortable with it. The manual isn't great as a tutorial but is a very useful reference. There's also a number of examples included which I've found essential. Once you get them compiling, you're half-way there. There's next to no Google help out there, so being able to look at another piece of code and work out what makes that work and mine fail has been priceless. There's also a tool called CITAS to import images and turn them into animations. It's rough round the edges but does the job. You can also use CITAS to define collision detection between objects, which is my next task. |
12 February 2016, 15:52 | #12 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,356
|
If you can get it to cooperate with GameSmith, I think AmigaE has a rather lean object orientation.
|
12 February 2016, 16:31 | #13 |
Registered User
Join Date: Apr 2012
Location: Cardiff
Posts: 407
|
|
12 February 2016, 17:49 | #14 |
Registered User
Join Date: Feb 2013
Location: Argentina
Posts: 281
|
Hi.
Congratulations! The game looks good! Could upload the source code to see it? Cheers |
14 February 2016, 14:07 | #15 |
Registered User
Join Date: Apr 2012
Location: Cardiff
Posts: 407
|
Hi. Thanks very much! I'm not confident enough in my C coding to release it yet and I don't want to lead people down the wrong path. I'm not doing much that isn't in the examples - I recommend the MoonRocks and parallax examples to get going.
|
14 February 2016, 14:30 | #16 |
Registered User
Join Date: Apr 2012
Location: Cardiff
Posts: 407
|
My biggest remaining challenge is to use a tile-map for my rooms.
There's an example included with GameSmith but it's not well described. I can't tell what format the tiles and the map are in (except that's pretty raw binary) or how I'd create those files myself. Preferably, I'd just use an IFF file for my tiles and a CSV file to define my map. Could anyone make sense of these files or (even better) point me towards an example using an IFF file? I'll be using that "gs_blit_copy()" function to paste the tiles into a big bitmap. Here's the relevant code from the example: Code:
/* "TILES.DAT" is the graphics data for the tiles -- each tile takes 192 bytes (16 x 16 x 6 planes), and there are 107 tiles in the set. "MAP.DAT" is the tilemap -- 200x10 tiles, 1 byte per tile. */ UBYTE *tilesdata=0; /* Pointer to chunk of chip data for tiles graphics */ UBYTE map[MAPHEIGHT][MAPWIDTH]; /* Map array - y,x (NOT x,y, because of how it's loaded in, ROW at a time.) */ /* Struct for blitting tiles to screen (just using same struct and changing "data" pointer for each) */ struct blit_struct blit = { 0,0,0, 6,0xff,1,16,32, 0,0,0,0,0,0,0 }; . . /* Load tile graphics */ file=Open("TILES.DAT",MODE_OLDFILE); if(file==0)Quit("Can't Open File: TILES.DAT!"); len=Read(file,(BYTE *)tilesdata,TILESIZE*NUMTILES); if(len==-1)Quit("Can't Read File: TILES.DAT!"); Close(file);file=0; /* Load tilemap */ file=Open("MAP.DAT",MODE_OLDFILE); if(file==0)Quit("Can't Open File: MAP.DAT!"); len=Read(file,(BYTE *)&map[0][0],MAPWIDTH*MAPHEIGHT); if(len==-1)Quit("Can't Read File: MAP.DAT!"); Close(file);file=0; . . gsvp=display.vp; /* Set pointer to gs_viewport */ bm=gsvp->bitmap1; /* Set pointer to bitmap1 */ /* Blit first screen of tiles to the visible display (and blit the same thing again, one screen to the right) */ for(y=0;y<SCREENHEIGHT;y++) { for(x=0;x<=SCREENWIDTH;x++) { /* Set pointer to graphics data */ blit.data=(USHORT *)tilesdata+(96*(map[y][x])); /* blit tile into bitmap (twice) */ gs_blit_copy(&blit,bm,(x<<4)+16,y<<4); /* "<<4" == "*16" */ gs_blit_copy(&blit,bm,(x<<4)+352,y<<4); } } Last edited by clebin; 14 February 2016 at 15:14. |
14 February 2016, 20:30 | #17 |
Zone Friend
Join Date: May 2006
Location: France
Posts: 1,836
|
the only drawback using GameSmith is that it's development has been halted long ago and bugs and new features will never happens. That's too bad we can't get our hand in the source code.
Source code says it contains 106 16x16 tiles with 6 bitplanes, reading it with Maptapper describe it as ACBM format. Kamelito Last edited by kamelito; 15 February 2016 at 00:09. |
15 February 2016, 20:25 | #18 | |
Registered User
Join Date: Apr 2012
Location: Cardiff
Posts: 407
|
Quote:
"All graphics data (except the mask) must be contiguous in memory starting with the first plane (from 0 to n)" I've learnt a lot since yesterday but I'm still blitting garbage to the screen at the moment. Knowing the name of the format will be a great help. |
|
16 February 2016, 19:28 | #19 |
Registered User
Join Date: Apr 2012
Location: Cardiff
Posts: 407
|
Progress! I can now blit 16x16 tiles directly to a bitmap. A little test using my bubbles:
The key has been the GetImage package on Aminet: http://aminet.net/package/dev/c/GetImage GetImage produces C source, including a imageData array that I can use in my "blit_struct". I also modified GetImage slightly so it can write the image data into a binary file. The blue bubbles are from a file, the green from an array. Still some work to do before I can load real maps, but I'm happy! |
16 February 2016, 21:30 | #20 |
Zone Friend
Join Date: May 2006
Location: France
Posts: 1,836
|
Good job, always nice to see progress in Amiga land.
Kamelito |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
GameSmith bookmarked manual | sir_xeno | project.Amiga File Server | 0 | 27 July 2012 10:33 |
My Projects | Amigaman | Hardware mods | 17 | 24 January 2011 18:11 |
Who here uses GameSmith with C or C++ | davideo | Coders. General | 20 | 12 June 2010 15:34 |
Gamesmith | Jherek Carnelia | request.Apps | 7 | 12 March 2008 23:40 |
Proposal: Split Amiga projects and PC projects? | andreas | project.Amiga Game Factory | 4 | 12 February 2008 12:00 |
|
|