• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Homemade free game

Joined
Dec 2, 2009
Messages
3,351 (0.64/day)
System Name Dark Stealth
Processor Ryzen 5 5600x
Motherboard Gigabyte B450M Gaming rev 1.0
Cooling Snowman, arctic p12 x2 fans
Memory 16x2 DDR4 Corsair Dominator Pro
Video Card(s) 3080 10gb
Storage 2TB NVME PCIE 4.0 Crucial P3 Plus, 1TB Crucial MX500 SSD, 4TB WD RED HDD
Display(s) HP Omen 34c (34" monitor 3440x1440 165Hz VA panel)
Case Zalman S2
Power Supply Corsair 750TX
Mouse Logitech pro superlight, mx mouse s3, Razer Basiliskx with battery
Keyboard Custom mechanical keyboard tm680
Software Windows 11
Benchmark Scores 70-80 fps 3440x1440 on cyberpunk 2077 max settings
@brandon
I wont program it, until it is a "real" game with 3 levels.
So, don't get angry with me, but the problem is that i don't know how to do it :p
(will probably find a way for it ;) )

@derek
I did a simple calculation, of what is the minimum spec for the game till now.
My PC has a ~3.1Ghz processor (with 4 cores) and the game uses up to 2%
If 3.1 is 100% what is 2%? 0.062 Ghz or ~60Mhz
Is this for nintendo? :D

Maybe if i add sound, the game will need much more resources, will see...
 
Last edited:

PVTCaboose1337

Graphical Hacker
Joined
Feb 1, 2006
Messages
9,501 (1.43/day)
Location
Texas
System Name Whim
Processor Intel Core i5 2500k @ 4.4ghz
Motherboard Asus P8Z77-V LX
Cooling Cooler Master Hyper 212+
Memory 2 x 4GB G.Skill Ripjaws @ 1600mhz
Video Card(s) Gigabyte GTX 670 2gb
Storage Samsung 840 Pro 256gb, WD 2TB Black
Display(s) Shimian QH270 (1440p), Asus VE228 (1080p)
Case Cooler Master 430 Elite
Audio Device(s) Onboard > PA2V2 Amp > Senn 595's
Power Supply Corsair 750w
Software Windows 8.1 (Tweaked)
Some suggestions for you from a programmer:

I did a game last year, similar, anyway, hit detection, needs improvement. That is the TOUGHEST part IMO. Seems you only have a "line" of hit detection, like when player, which we will call P, is equal to the enemy (e), then detect hit, IE:



Code:
if ((px = ex) && (py = pe)) then
HitDetection();

That would be my guess, you detect x and y, but you need a little tolerance around it. So assuming that the origin of the enemy is in the bottom right, you can say like if abs(px - ex) = 10 then blah blah blah. Therefore you extend the hit range. You will have to do this for both character and enemy.

Also, the blue enemy made me lose multiple lives, but that can be modifed with hit detection. ALSO: make is so we can shoot slower!. Also a rolling background would be niec, like a GIF of space going by or something.
 
Joined
Dec 2, 2009
Messages
3,351 (0.64/day)
System Name Dark Stealth
Processor Ryzen 5 5600x
Motherboard Gigabyte B450M Gaming rev 1.0
Cooling Snowman, arctic p12 x2 fans
Memory 16x2 DDR4 Corsair Dominator Pro
Video Card(s) 3080 10gb
Storage 2TB NVME PCIE 4.0 Crucial P3 Plus, 1TB Crucial MX500 SSD, 4TB WD RED HDD
Display(s) HP Omen 34c (34" monitor 3440x1440 165Hz VA panel)
Case Zalman S2
Power Supply Corsair 750TX
Mouse Logitech pro superlight, mx mouse s3, Razer Basiliskx with battery
Keyboard Custom mechanical keyboard tm680
Software Windows 11
Benchmark Scores 70-80 fps 3440x1440 on cyberpunk 2077 max settings
Ok, thanks for the reply professional :)
First of all, i don't get the "line" of hit detection.
You mean only a line of code? Or a line which it gets detected?
If you want a hit detection between the player and the enemy, i simply think that is a bit stupid.
(at least for me)
The idea is that if the enemy passes off the screen, you lose a point.
The other kind of enemy, moves faster and makes you lose more points.
Again, what i got from your hit detection, is that if the spaceship gets "crashed" with the alien
it loses 3 points. (with the square alien i mean)
The slower shooting is not a prob, you know.
I don't know how to move a background in allegro, because i am learning new thing every day!
Last but not least, the algorithm for the detection is ready, i am serious.
I just think that it is stupid and wanted to add something new to this kind of game and set it as a comment for later.
Also, i made 4 for both aliens x and y and ships x and y lines of code about the detection and is really tough i know.
(needs math logic)
 

Completely Bonkers

New Member
Joined
Feb 6, 2007
Messages
2,576 (0.41/day)
Processor Mysterious Engineering Prototype
Motherboard Intel 865
Cooling Custom block made in workshop
Memory Corsair XMS 2GB
Video Card(s) FireGL X3-256
Display(s) 1600x1200 SyncMaster x 2 = 3200x1200
Software Windows 2003
@Aleksander

Due to the TPUgiveaway competition last month, I set various tweaks in my gpu control panel, incl. forced sync to screen refresh rate which on my TFT is 60Hz. However, I think you game is also forcing a 80fps sync, and there was a conflict between my TFT driver based sync refresh at 60fps and your software synced refresh. The poor PC was working "In the interference gap between the two conflicting sync refreshes".

I've reset my gpu drivers.

I am now on 80fps and 5-12% utilisation on a P4. So all is fine. Tip: I wouldnt use a forced fps sync in your game. You need to link the speed of the aliens, ie your main engine, to a CLOCK rather than to a software loop and then artificially slow down the loop using a wait-to-sync to 80fps.

+++++

Alek, Are you using sprites in your game, or are you using line/box draw routines? Have you looked at some of the code of other arcade games at allegro.cc? Do you have any books to help you with games and allegro, e.g. http://www.amazon.co_uk/dp/1592003834/?tag=tec053-21

You first game is coming on fine... just make sure you get some tips from other people who have posted their source code on allegro, or from a book that will tell you about event handling that might help you with the main engine.

+++++

Looking forward to next version!
 
Joined
Dec 2, 2009
Messages
3,351 (0.64/day)
System Name Dark Stealth
Processor Ryzen 5 5600x
Motherboard Gigabyte B450M Gaming rev 1.0
Cooling Snowman, arctic p12 x2 fans
Memory 16x2 DDR4 Corsair Dominator Pro
Video Card(s) 3080 10gb
Storage 2TB NVME PCIE 4.0 Crucial P3 Plus, 1TB Crucial MX500 SSD, 4TB WD RED HDD
Display(s) HP Omen 34c (34" monitor 3440x1440 165Hz VA panel)
Case Zalman S2
Power Supply Corsair 750TX
Mouse Logitech pro superlight, mx mouse s3, Razer Basiliskx with battery
Keyboard Custom mechanical keyboard tm680
Software Windows 11
Benchmark Scores 70-80 fps 3440x1440 on cyberpunk 2077 max settings
I will try to change the forced sync after a learn more and will tell you.
Normally, i said in another post, the ship is with 3 boxes, so all things you see are simple box draw
routines. I have seen a lot of games and of course that nice book. The only problem with both is
that none has allegro 5.0.4, the one i am using and that is the latest. The book uses the old 4.0 and
the games use that old one too. Will try to add the new version as fast as possible, although it will require much more work than the other versions.
 

Completely Bonkers

New Member
Joined
Feb 6, 2007
Messages
2,576 (0.41/day)
Processor Mysterious Engineering Prototype
Motherboard Intel 865
Cooling Custom block made in workshop
Memory Corsair XMS 2GB
Video Card(s) FireGL X3-256
Display(s) 1600x1200 SyncMaster x 2 = 3200x1200
Software Windows 2003
Yes, I think Allegro is designed for using sprites. I think the draw boxes (and alien circles) are not going to be as efficient just due to the way they are "calculated and drawn each time" rather than "just placed" if they were sprites. There is a lot of real-time calculation dealing with drawing whereas sprites have very fast bitmap algorithms.

Although A5 and A4 are quite different, don't be put off by looking at A4 source-code. When learning a new language, actually the exercise of TRANSLATING one language to another language is a great way to learn. Take a look at some of those gaming routines published in A4 and convert them to A5. I really believe that it will be a useful and educational exercise.

I do agree though that a games book specifically targeted to A5 would be the greatest help for you at this moment... but I think an A4 book is better than nothing. Although the language has changed a little, the concepts and algorithms are the same, and the explanations could help you get 80% there with A5. Actually, this is a better way of learning than just copy+paste code directly out of an A5 source!
 
Joined
Jan 12, 2010
Messages
1,526 (0.29/day)
System Name Custom Built
Processor AMD Ryzen 5 3600
Motherboard Asus PRIME A520M-A
Cooling Stock heatsink/fan
Memory 16GB 2x8GB Corsair Vengeance LPX 2400MHz
Video Card(s) MSI 1050Ti 4GB
Storage KINGSTON SNVS250G 256GB M.2 + 2 data disks
Display(s) Dell S2421NX
Case Aerocool CS103
Audio Device(s) Realtek
Power Supply Seasonic M12II-520 EVO
Mouse Logitech MX Master 2S
Keyboard Logitech
Software Windows 11 Pro 64-bit
@derek
I did a simple calculation, of what is the minimum spec for the game till now.
My PC has a ~3.1Ghz processor (with 4 cores) and the game uses up to 2%
If 3.1 is 100% what is 2%? 0.062 Ghz or ~60Mhz
Is this for nintendo? :D

Maybe if i add sound, the game will need much more resources, will see...

Nintendo NES lol :)
Maybe, in my case my netbook is a Atom N455 working @ 1GHz (battery mode), 1GB RAM DDR3 at 300MHz I think, and an intel GMA 3150 GPU, and it works super smooth using 9% CPU, so your game doesn't need many resources, maybe only a 3D capable video card and 500+ MHz CPU. Sound wouldn't consume much as far I know :)
 
Last edited:
Joined
Dec 2, 2009
Messages
3,351 (0.64/day)
System Name Dark Stealth
Processor Ryzen 5 5600x
Motherboard Gigabyte B450M Gaming rev 1.0
Cooling Snowman, arctic p12 x2 fans
Memory 16x2 DDR4 Corsair Dominator Pro
Video Card(s) 3080 10gb
Storage 2TB NVME PCIE 4.0 Crucial P3 Plus, 1TB Crucial MX500 SSD, 4TB WD RED HDD
Display(s) HP Omen 34c (34" monitor 3440x1440 165Hz VA panel)
Case Zalman S2
Power Supply Corsair 750TX
Mouse Logitech pro superlight, mx mouse s3, Razer Basiliskx with battery
Keyboard Custom mechanical keyboard tm680
Software Windows 11
Benchmark Scores 70-80 fps 3440x1440 on cyberpunk 2077 max settings
@bonkers
Am trying to learn as much as possible, even though there is no way i can learn the allegro5 with books there are some guys who made videos(a lot of crappy videos though)
So a book would be awesome, it has its advantages over a video tutorial.
After all the video is based on the book :)
There is a manual for allegro 5.0.4 from allegro site and i am based a lot in that for now.

@derek
It would be perfect to program games for mobile phones, cuz as i see, the iphone is part of allegro manual. Also, there should be a lot to learn and optimize cpu usage.
Unfortunately, this time the update of the game will be quite a bit longer than before...
 
Top