English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. C/C++ (https://eab.abime.net/forumdisplay.php?f=118)
-   -   Making games in C. graphics.library? (https://eab.abime.net/showthread.php?t=99712)

elanstra 18 November 2019 17:58

Making games in C. graphics.library?
 
To my own shame I'm very new to the Amiga :crying, so please forgive me if this maybe has an obvious answer.


I've seen from Compute's "Mapping the Amiga" and Sybex's "Amiga Programmer's Handbook" that the graphics.library provides functions for sprites, bobs, vsprites, etc.


Is this the way to go for making games in C for the Amiga? Or are there other more recommendable options? SDL for example comes to my mind.


Thanks a lot in advance.

redblade 18 November 2019 21:09

If you goto aminet.net and download RKMCompanion.lha on fredfish disk 344 for Kickstart 1.3 machines and Fredfish disks 741, 742 for kickstart 2+. They have C code for using the primitives functions (Sprites).

What Amiga are you programming for?

jotd 18 November 2019 21:24

C is okay (get a good cross compiler like gcc or vbcc).

But don't try to create games with SDL. It will be slow as hell even on a 68060 because of damn c2p conversion. Use graphics library routines or direct hardware banging instead.

I'm currently creating a C++ game using SDL interface but amiga hardware underneath (porting a SDL game I made 9 years ago). That could be a good compromise (the game isn't working yet but it's taking shape)

deimos 18 November 2019 21:26

Quote:

Originally Posted by elanstra (Post 1359834)
To my own shame I'm very new to the Amiga :crying, so please forgive me if this maybe has an obvious answer.


I've seen from Compute's "Mapping the Amiga" and Sybex's "Amiga Programmer's Handbook" that the graphics.library provides functions for sprites, bobs, vsprites, etc.


Is this the way to go for making games in C for the Amiga? Or are there other more recommendable options? SDL for example comes to my mind.


Thanks a lot in advance.

It depends where your interest is.

Mine is is the original Amiga hardware but I don't have the inclination to code everything in assembly, so I code against the hardware in C, replacing only the bits that matter with hand written assembly routines.

In my opinion the operating system friendly side of Amiga game programming was never developed as much as it could be - there were excellent games and excellent applications, but they rarely met.

drHirudo 19 November 2019 09:21

I coded many games in C using the graphics library Sprites and BOBs. Almost all my Amiga games are running from Workbench and multitasking. With screenmode requester at the beginning, so even graphics cards users can play them. Most games on Amiga closed the Workbench and took complete control over the system for fluent animations and gameplay. If you have task in the background it is very hard to achieve smooth movements and gameplay. Any process can slow down the system and it gets noticeable. For example floppy insert/remove, hard disk loading, even screen savers and Internet. For machines with 68000 CPU having Workbench in the background means almost always slowdowns.

elanstra 19 November 2019 19:07

Thanks everybody for the great answers. Awesome forum!

I have an A1200 with 4MB Fast RAM. Right now I'm programming with SAS/C. It's a bit slow compiling, so probably I'll have to move to a cross-compiler as suggested by jotd. Only trouble is the room where I have the Amiga is kind of a retro room. No modern computers. I even listen music with a Technics tape deck :-D

I have good experience with assembler in 8-bits (Z80 and 6510), so probably I'll end doing as deimos mentioned and having some pieces in ASM (once I learn a bit of M68k).

I've downloaded the RKMCompanion that redblade mentioned. I already had the PDFs, so it will be a great companion indeed.

Great tip, drHirudo. I'll check how to do it once I get further, if I see my game slowing down.

Ami 19 November 2019 19:20

Quote:

Originally Posted by drHirudo (Post 1359962)
I coded many games in C using the graphics library Sprites and BOBs.

Did you used GELs functions?

balrogsoft 26 November 2019 13:34

Quote:

Originally Posted by elanstra (Post 1360042)
I have an A1200 with 4MB Fast RAM. Right now I'm programming with SAS/C. It's a bit slow compiling, so probably I'll have to move to a cross-compiler as suggested by jotd.

I'm using SAS / C too, I compile my code under UAE, using a shared folder with UAE, it will let you editing with modern editors, and compile in SAS / C fast with UAE.

Quote:

Originally Posted by elanstra (Post 1360042)

I've downloaded the RKMCompanion that redblade mentioned. I already had the PDFs, so it will be a great companion indeed.


I have found that some RKMCompanion examples are not very good, they run slow on my A500 and with flickering graphics. There are some examples more optimized, look on aminet, or github, there are some interesting examples:

http://aminet.net/package/dev/src/ScrollingTrick
https://github.com/astrofra/amiga-experiments
https://github.com/alpine9000/EWGM

This reading about graphics.library is also interesting:

https://wiki.amigaos.net/wiki/Classi...ffered_Display

redblade 26 November 2019 19:29

Quote:

Originally Posted by balrogsoft (Post 1361476)
I'm using SAS / C too, I compile my code under UAE, using a shared folder with UAE, it will let you editing with modern editors, and compile in SAS / C fast with UAE.




I have found that some RKMCompanion examples are not very good, they run slow on my A500 and with flickering graphics. There are some examples more optimized, look on aminet, or github, there are some interesting examples:

http://aminet.net/package/dev/src/ScrollingTrick
https://github.com/astrofra/amiga-experiments
https://github.com/alpine9000/EWGM

This reading about graphics.library is also interesting:

https://wiki.amigaos.net/wiki/Classi...ffered_Display

Hi Balrogsoft. I like your youtube channel. Not many fast OS friendly games for the Amiga 500. The ones I remember were Egyptian Run and Amoeba invaders in the 80s. How fast was the scrollingtrick on your A500?

kamelito 26 November 2019 20:36

check this site also
http://www.pjhutchison.org/tutorial/amiga_c.html

hitchhikr 27 November 2019 10:24

You may want to check this:

http://aminet.net/search?query=cmanual

hitchhikr 28 November 2019 21:26

Aminet is down, try those:

http://franck.charlet.pagesperso-ora...mp/CManual.lzh
http://franck.charlet.pagesperso-ora...p/CManual2.lzh
http://franck.charlet.pagesperso-ora...p/CManual3.lzh
http://franck.charlet.pagesperso-ora...p/CManual4.lzh
http://franck.charlet.pagesperso-ora...p/CManual5.lzh

f.

balrogsoft 01 December 2019 14:55

Quote:

Originally Posted by redblade (Post 1361563)
Hi Balrogsoft. I like your youtube channel. Not many fast OS friendly games for the Amiga 500. The ones I remember were Egyptian Run and Amoeba invaders in the 80s. How fast was the scrollingtrick on your A500?


I don't remember if it runs at 50 fps, anyway ScrollingTrick uses hardware directly for blitting, so it might not be the best example using graphics.library. There really aren't many examples in C, at least using system functions. The RKM examples use the ScrollVPort, RethinkDisplay functions, which are not very fast. ScrollVPort makes my code 25% slower even if there are not changes on the viewport.

kamelito 01 December 2019 21:39

@balrogsoft what is your youtube channel?

balrogsoft 01 December 2019 22:12

Quote:

Originally Posted by kamelito (Post 1362570)
@balrogsoft what is your youtube channel?



My channel? I only have some old "Bit a bit" TV computer shows from spanish television.


https://www.youtube.com/channel/UCYo...ayNoOcFNTyZ6aA

redblade 02 December 2019 20:54

Quote:

Originally Posted by balrogsoft (Post 1362577)
My channel? I only have some old "Bit a bit" TV computer shows from spanish television.


https://www.youtube.com/channel/UCYo...ayNoOcFNTyZ6aA

My fault, maybe I was looking at your c2p gifs on your website. I thought you did some Street fighter 2 videos as well. :nuts It must of been some other amiga channel I saw

balrogsoft 02 December 2019 21:28

Quote:

Originally Posted by redblade (Post 1362747)
My fault, maybe I was looking at your c2p gifs on your website. I thought you did some Street fighter 2 videos as well. :nuts It must of been some other amiga channel I saw

Ok, but the c2p gifs aren't gifs images, they are javascript effects running in realtime. I made them a lot of years ago, when canvas didn't exists in javascript standards.


All times are GMT +2. The time now is 03:49.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.04751 seconds with 11 queries