Lazarus

Programming => Graphics and Multimedia => Games => Topic started by: lainz on January 01, 2018, 03:28:42 pm

Title: Game Contest 2018
Post by: lainz on January 01, 2018, 03:28:42 pm
Welcome to the Lazarus Game Contest 2018

Since 2015 we're making contests on the Graphics forum. And now we have the new Games sub forum! The previous year we had five games in the Graphics Contest. So this year we will focus on games!

Rules:
- The game you submit must be a new game, not a work in progress game or an already made game.
- Must be new games in this context: you make them and you previously not released them, so are your own new games. These can be remakes no problem at all, the idea is that you make the game in 6 months, and don't use a game you already built.
- The game source code must be released as open source, GPL or MIT.
- The game must be made with FPC or Lazarus, but you can use third party libraries compiled with other languages (SDL for example).
- All games must follow the topic described below.
- All games will be voted in a single poll (one for retro and one for modern), does not matter the genre of the game.

Topic:
- The topic is 'retro games' and 'modern games'

We will try to make a poll for retro games and a poll for modern games so it is fair.

Deadline:
- Until 31 July 2018. No exceptions. On August 2018 we will vote for the best game.

Entry

Games
eny: Petris
https://forum.lazarus.freepascal.org/index.php/topic,39495.msg271757.html#msg271757

Lulu: Fire Wire
http://forum.lazarus.freepascal.org/index.php/topic,39495.msg281613.html#msg281613

mrguzgog: "Some Game" or "Annoying Game"?
http://forum.lazarus.freepascal.org/index.php/topic,39495.msg274693.html#msg274693

MSABC: The Most Stupid Computer Game
http://forum.lazarus.freepascal.org/index.php/topic,39495.msg281127.html#msg281127

User137:
https://forum.lazarus.freepascal.org/index.php/topic,39495.msg286595.html#msg286595

Paul_: Pixel Warrior
https://forum.lazarus.freepascal.org/index.php/topic,39495.msg291692.html#msg291692

Lainz: Arkanoid
https://forum.lazarus.freepascal.org/index.php/topic,39495.msg292857.html#msg292857

Demos
(Not participating)

Lainz: Mouse Down and Draw Circles
https://forum.lazarus.freepascal.org/index.php/topic,39495.msg271305.html#msg271305

Turrican: Lainz Circles (With his own library)
https://forum.lazarus.freepascal.org/index.php/topic,39495.msg271543.html#msg271543

Lainz: Waves
http://forum.lazarus.freepascal.org/index.php/topic,39495.msg282116.html#msg282116
Title: Re: Game Contest 2018
Post by: lainz on January 01, 2018, 03:42:11 pm
Quote
- The game you submit must be a new game, not a work in progress game or an already made game.
Ahhh... this can't be happening to me!  %) Maybe, a game started on 28.12.2017 is still eligible? :-[

If it is not released yet you can. Is a really new game and 3 days will not make such a big difference.

I created an account on Pascal Game Development forum, but seems that is not that simple to get in. So if anyone has an account there, please share this contest so it gets more people in. Thanks.
Title: Re: Game Contest 2018
Post by: Eugene Loza on January 01, 2018, 03:44:14 pm
Quote
If it is not released yet you can.
Oops, I've just re-read the announcements and saw my new game doesn't qualify (while retro-style, still much "newer" than 16-bit Sega)... Anyway, thumbs up!
Quote
please share this contest
Done:
http://www.pascalgamedevelopment.com/showthread.php?32631-Lazarus-Game-Contest-2018&p=148639#post148639
Title: Re: Game Contest 2018
Post by: molly on January 01, 2018, 06:36:26 pm
Hi Lainz,

Thank you for the initiative !

There are still some things that appear a bit vague to me (most likely too early in the year for me  :D ) but perhaps it could be an idea to make things a bit more clear if possible ?

- The game you submit must be a new game, not a work in progress game or an already made game.
I think i do understand what you meant there but for the sake of clarity: so, remakes (of existing (retro-)titles) are not allowed ? What about taking an existing game-concept and give it a twirl and/or twist ?

Quote
- 2D games only
There are (retro) 3D games even in 8 bit era (wireframed if hardware really lacked for example). 2.5D was also very popular. Did you perhaps meant: Game is not allowed to depend (or make use of) 3D hardware (acceleration) ?

I understand that above definition could perhaps be problematic for certain (external) libraries as it is not always clear for everyone that behind the scenes gl is being used similar as for DX.

Thank you.

Edit: Please also realize that games could be submitted for targets that nobody here owns or is able to judge. Those targets have their own specific hardware and will be used whether code was written in Pascal or not  ;)
Title: Re: Game Contest 2018
Post by: Paul_ on January 01, 2018, 06:47:45 pm
I'm in! :)

- This year topic is 'retro games', so the graphics and music of the game must be retro style https://forum.lazarus.freepascal.org/index.php/topic,39495.msg271263.html#msg271263

Graphics, audio.. can be third party or only own?
Title: Re: Game Contest 2018
Post by: lainz on January 01, 2018, 06:55:13 pm
Hi molly, thanks, I will explain:

- Must be new games in this context: you make them and you previously not released them, so are your own new games. These can be remakes no problem at all, the idea is that you make the game in 6 months, and don't use a game you already built.

- About 2D and 3D and 2.5 D: you're right, I remember these games. Well I can remove that line for the good. You can use OpenGL and 3D, but I mean these must be retro, like nothing super 3D of nowdays =) Like the 3D of Nintendo 64 or PS2, or less of course.

- And for targets of real consoles, arm or whatever: of course they can be in! And if we can't play these, at least a video will be enough. Edit: but the sources need to be here even If we can't compile them, the goal of the contest is to share.
Title: Re: Game Contest 2018
Post by: lainz on January 01, 2018, 06:56:00 pm
I'm in! :)

- This year topic is 'retro games', so the graphics and music of the game must be retro style https://forum.lazarus.freepascal.org/index.php/topic,39495.msg271263.html#msg271263

Graphics, audio.. can be third party or only own?

Can be third party, as well as the assets, but these must be open source compatible, because all we will share our sources on GitHub at the end of the contest.
Title: Re: Game Contest 2018
Post by: molly on January 01, 2018, 07:31:49 pm
Thank you for the explanations Lainz.

They made things a whole lot more clear (and quite frankly i forgot to think about videotaping  :-[).
Title: Re: Game Contest 2018
Post by: lainz on January 01, 2018, 08:19:21 pm
Thank you for the explanations Lainz.

They made things a whole lot more clear (and quite frankly i forgot to think about videotaping  :-[).

Good questions: Good answers =)

I hope at least we will have 10 games for this year, if not at least we're opening this room for the future.
Title: Re: Game Contest 2018
Post by: lainz on January 02, 2018, 04:16:09 am
Hi, this is my first submission for the contest, remember that you can submit any number of games (In my case maybe is the first and the last, who knows?)

The goal is to make circles, because all we need to ensure our mouse is working well and become a 2D artist some day, maybe not but =)

This remembers me some old games that comes on CD cases of magazines, single goal games that worth nothing.

The screen resolution of the game is 640x480 to keep it retro, but you can maximize the window if you want. And hopefully the graphics are retro enough, if not please tell me and I will try to fix that!

Instructions:
- Compile
- Hold down the mouse button and try to draw a circle, if it matches it adds score, in the top left corner of the window.

Thanks to a JSFiddle for the calculations of 'isCircle' function, converted from JavaScript to Pascal.

And bugs...
- If you draw an horizontal line of exactly 1 of width between two of the grid points it thinks is a circle also!

This game is to break the ice, well if there is some Ice on my country (nothing but the summer sun), so the good games will be these you make.

Tell your friends about the contest!

Edit:

To make my game more retro I'm removing the antialias lines, change this line:
Code: Pascal  [Select][+][-]
  1. Bitmap.DrawLineAntialias(x, y, x2, y2, BGRA(last_color.red, last_color.green, last_color.blue, SHADOW_STEP * i), 2);

To this:
Code: Pascal  [Select][+][-]
  1. Bitmap.DrawLine(x, y, x2, y2, BGRAWhite, True);
Title: Re: Game Contest 2018
Post by: turrican on January 02, 2018, 12:35:30 pm
I'm in!  :D :D :D :D :D
Title: Re: Game Contest 2018
Post by: lainz on January 02, 2018, 02:44:10 pm
I'm in!  :D :D :D :D :D

Thankyou.

About the topic of the contest:
- I'm adding retro games and modern games

Why?
Because if we allow retro games with any graphics quality in fact it becomes a modern game slowly!
So you can submit your game but tell us in wich category you will put, if in retro or in modern, so you can compete with these games accordingly. Will be 2 polls one for retro and one for modern, so it is fair.
Title: Re: Game Contest 2018
Post by: turrican on January 02, 2018, 04:01:42 pm
Hi, this is my first submission for the contest, remember that you can submit any number of games (In my case maybe is the first and the last, who knows?)

The goal is to make circles, because all we need to ensure our mouse is working well and become a 2D artist some day, maybe not but =)

This remembers me some old games that comes on CD cases of magazines, single goal games that worth nothing.

The screen resolution of the game is 640x480 to keep it retro, but you can maximize the window if you want. And hopefully the graphics are retro enough, if not please tell me and I will try to fix that!

Instructions:
- Compile
- Hold down the mouse button and try to draw a circle, if it matches it adds score, in the top left corner of the window.

Thanks to a JSFiddle for the calculations of 'isCircle' function, converted from JavaScript to Pascal.

And bugs...
- If you draw an horizontal line of exactly 1 of width between two of the grid points it thinks is a circle also!

This game is to break the ice, well if there is some Ice on my country (nothing but the summer sun), so the good games will be these you make.

Tell your friends about the contest!

Edit:

To make my game more retro I'm removing the antialias lines, change this line:
Code: Pascal  [Select][+][-]
  1. Bitmap.DrawLineAntialias(x, y, x2, y2, BGRA(last_color.red, last_color.green, last_color.blue, SHADOW_STEP * i), 2);

To this:
Code: Pascal  [Select][+][-]
  1. Bitmap.DrawLine(x, y, x2, y2, BGRAWhite, True);

It's very well made example! But canvas is really CPU bond. Would be nice doing this using OpenGL :)
Title: Re: Game Contest 2018
Post by: lainz on January 02, 2018, 04:06:08 pm
It's very well made example! But canvas is really CPU bond. Would be nice doing this using OpenGL :)

Thanks!

I don't know how to do this with OpenGL, in fact there are just a few lines drawn and is that thing I don't know how to do. It is not very well optimized yet, but on i7 4790 it draws everything in less than 3ms, and the timer is for 15 ms, so is enough time to render. I need to try this on a notebook or something slower to see.
Title: Re: Game Contest 2018
Post by: turrican on January 02, 2018, 05:49:05 pm
It's very well made example! But canvas is really CPU bond. Would be nice doing this using OpenGL :)

Thanks!

I don't know how to do this with OpenGL, in fact there are just a few lines drawn and is that thing I don't know how to do. It is not very well optimized yet, but on i7 4790 it draws everything in less than 3ms, and the timer is for 15 ms, so is enough time to render. I need to try this on a notebook or something slower to see.

I'm going to port your example to my framework. It will be a nice example to include :)
Title: Re: Game Contest 2018
Post by: lainz on January 02, 2018, 05:50:05 pm
I'm going to port your example to my framework. It will be a nice example to include :)

Thanks, what's your framework?
Title: Re: Game Contest 2018
Post by: turrican on January 02, 2018, 07:14:28 pm
I'm going to port your example to my framework. It will be a nice example to include :)

Thanks, what's your framework?

A little OOP framework I did for ZenGL. You can find here : https://github.com/turric4n/SimpleZGL

I ported part of your code to my Framework. Under 3% of CPU and uses DirectX for Windows and OpenGL for linux. I have not much time today but tomorrow I will end. I compiled only for Windows because now I'm working under a Windows machine.

Here is the link : http://www16.zippyshare.com/v/nygKSJde/file.html
Title: Re: Game Contest 2018
Post by: lainz on January 03, 2018, 01:00:03 am
I can see it works really smooth. 1% CPU on my machine, and GPU usage is higher of course =)

But also I see is not exactly what I did. For example seems that the grid lines dissapears when fading out and some other minor differences.

I've not touched the code but I'm sure you can improve it =)
Title: Re: Game Contest 2018
Post by: turrican on January 03, 2018, 09:17:23 am
I did it on 10 min. Today i'm going to port all features. But you can complete the code if you want :)
Title: Re: Game Contest 2018
Post by: lainz on January 03, 2018, 12:29:31 pm
Thanks you're the one who knows how yo use it, I did not try yet =)
Title: Re: Game Contest 2018
Post by: turrican on January 03, 2018, 02:28:53 pm
I added your circle detection and line drawing code.

Here is the code : https://github.com/turric4n/SimpleZGL/tree/master/examples/Lainz_Circle

Here is precompiled binary for Win32 : http://www11.zippyshare.com/v/jqIBtyji/file.html
Title: Re: Game Contest 2018
Post by: lainz on January 03, 2018, 04:57:31 pm
I added your circle detection and line drawing code.

Here is the code : https://github.com/turric4n/SimpleZGL/tree/master/examples/Lainz_Circle

Here is precompiled binary for Win32 : http://www11.zippyshare.com/v/jqIBtyji/file.html

Amazing! Super fast and nice =)
Title: Re: Game Contest 2018
Post by: turrican on January 03, 2018, 07:10:11 pm
Thanks!
Title: Re: Game Contest 2018
Post by: eny on January 04, 2018, 10:06:41 pm
For more inspiration a long overdue block dropping game :)

http://wiki.lazarus.freepascal.org/Petris
Title: Re: Game Contest 2018
Post by: lainz on January 04, 2018, 11:56:14 pm
For more inspiration a long overdue block dropping game :)

http://wiki.lazarus.freepascal.org/Petris

Thanks. I love Tetris, I'm good at it, and I can't say that for another games like First Person Shooters =)

Added to the retro category. Also I've added turrican conversion of my code since the rules say nothing about conversions =)

Edit: here is my High Score =) 11:48251
Title: Re: Game Contest 2018
Post by: bylaardt on January 05, 2018, 12:15:40 am
Deadline:
- 6 months from now, until 31 June 2018. No exceptions. On August 2018 we will vote for the best game.

Code: Pascal  [Select][+][-]
  1. if Pos('31 june',lainz.text)>0 then
  2.   Exception.create('incompatibility found: Gregorian calendar and lainz date system.');
  3.  
Title: Re: Game Contest 2018
Post by: lainz on January 05, 2018, 12:31:35 am
Deadline:
- 6 months from now, until 31 June 2018. No exceptions. On August 2018 we will vote for the best game.

Code: Pascal  [Select][+][-]
  1. if Pos('31 june',lainz.text)>0 then
  2.   Exception.create('incompatibility found: Gregorian calendar and lainz date system.');
  3.  

Thankyou, I was still lost trying to understand =)

Edit: This is the hi score of my brother, level 12 is too fast! 12:70479
Title: Re: Game Contest 2018
Post by: Paul_ on January 05, 2018, 12:59:01 am
1% CPU on my machine

This is a little confusing on modern CPU's and Windows. At least for me, because:
- it's throttling whole time (so whats single % means?)
- cores are counted somehow, if you have 4 cores CPU (8 Hyper-Threading) so max. load is something like 10-12% per core (+ it depends on the applications, some will exceed that limit).
Title: Re: Game Contest 2018
Post by: turrican on January 05, 2018, 09:32:14 am
For more inspiration a long overdue block dropping game :)

http://wiki.lazarus.freepascal.org/Petris

Yeah, I like to port as example of my framework. Thanks!
Title: Re: Game Contest 2018
Post by: Ñuño_Martínez on January 05, 2018, 01:32:53 pm
I like to do something but I'm pretty busy right now.  Besides job, I started a project for the MSX-BASIC 2018 contest (people's still using '80 computers, and I think I need "to think different" and good old BASIC is great for this), and I'm forcing myself to release the first beta version of Allegro.pas 5 with Handoko's demonstration game and full Delphi compatibility (the ex_hello example compiles!). Then I should work harder on my game engine so I can do actual games someday...

What a life...  %)

Anyway, I'll be glad to test your games. Keep up the good job and show to those unityers how real games are made!
Title: Re: Game Contest 2018
Post by: eny on January 05, 2018, 05:46:58 pm
Thanks. I love Tetris, I'm good at it, and I can't say that for another games like First Person Shooters =)

Added to the retro category. Also I've added turrican conversion of my code since the rules say nothing about conversions =)

Edit: here is my High Score =) 11:48251
Glad you liked it. I only come to 20K-ish :)
It was more of a fun excercise to see what can be done with vanilla Lazarus.
I'd love to do something with SDL but time is always the problem.
Title: Re: Game Contest 2018
Post by: eny on January 05, 2018, 09:53:36 pm
And a quick Debian 9 compile...
Title: Re: Game Contest 2018
Post by: Edson on January 05, 2018, 10:24:01 pm
Interesting. I lost some Commodore 64 games, I made many yearas ago, in my tapes.

Maybe it's time to revive them in Lazarus.  :D
Title: Re: Game Contest 2018
Post by: lainz on January 07, 2018, 12:38:40 am
Interesting. I lost some Commodore 64 games, I made many yearas ago, in my tapes.

Maybe it's time to revive them in Lazarus.  :D

Want to see that!
Title: Re: Game Contest 2018
Post by: turrican on January 08, 2018, 09:19:50 am
Interesting. I lost some Commodore 64 games, I made many yearas ago, in my tapes.

Maybe it's time to revive them in Lazarus.  :D

That's very cool! If you need to rip audio from commodore 64 and use it from code, I can help you.
Title: Re: Game Contest 2018
Post by: molly on January 08, 2018, 09:34:30 am
If you need to rip audio from commodore 64 and use it from code, I can help you.
Hopefully you are aware that most (if not all) sid related music is made out of code. So unless you have a sid-emulator and 6502 emulator, there is hardly any use to 'rip' those music. Yes, i am aware of existence of sid-players but not aware of any written in Pascal.
Title: Re: Game Contest 2018
Post by: de_jean_7777 on January 08, 2018, 11:56:04 am
I'm in. Might as well create an actual game in my engine :D
Title: Re: Game Contest 2018
Post by: turrican on January 08, 2018, 12:20:52 pm
If you need to rip audio from commodore 64 and use it from code, I can help you.
Hopefully you are aware that most (if not all) sid related music is made out of code. So unless you have a sid-emulator and 6502 emulator, there is hardly any use to 'rip' those music. Yes, i am aware of existence of sid-players but not aware of any written in Pascal.
You can use libsid from pascal without problems. I do.
Title: Re: Game Contest 2018
Post by: Edson on January 08, 2018, 03:22:25 pm
Interesting. I lost some Commodore 64 games, I made many yearas ago, in my tapes.
Maybe it's time to revive them in Lazarus.  :D

That's very cool! If you need to rip audio from commodore 64 and use it from code, I can help you.
Fortunately my games had very simple sound. They were very simple. Anyway I have no idea how to create the sound in Lazarus.
In fact, I have no idea how to start developing my game. I don't know What libraries to use, or what emulator, or just Canvas methods.


Title: Re: Game Contest 2018
Post by: turrican on January 08, 2018, 06:14:17 pm
Interesting. I lost some Commodore 64 games, I made many yearas ago, in my tapes.
Maybe it's time to revive them in Lazarus.  :D

That's very cool! If you need to rip audio from commodore 64 and use it from code, I can help you.
Fortunately my games had very simple sound. They were very simple. Anyway I have no idea how to create the sound in Lazarus.
In fact, I have no idea how to start developing my game. I don't know What libraries to use, or what emulator, or just Canvas methods.

You can use SDL2 or Allegro there are very good frameworks and Pascal compatible.
Title: Re: Game Contest 2018
Post by: Handoko on January 08, 2018, 06:30:39 pm
I never tried SDL but I know Allegro (Allegro.pas) is very easy to start with because it has very good documentation with example codes. First time I read the documentation, I can start writing code on the same day.

Allegro wrapper for Pascal:
http://allegro-pas.sourceforge.net/

Allegro 5 documentation:
http://liballeg.org/a5docs/trunk/
Title: Re: Game Contest 2018
Post by: lainz on January 08, 2018, 11:32:43 pm
I did the opposite, just used SDL and not Allegro. But played Open Sonic (now Open Surge) that works with Allegro and runs very well.

I want to add that SDL handling of input is very primitive. I personally like some more OOP, like events for everything.
Title: Re: Game Contest 2018
Post by: turrican on January 09, 2018, 05:30:51 pm
And the most important... The imagination :)
Title: Re: Game Contest 2018
Post by: jwdietrich on January 09, 2018, 06:48:08 pm
Petris is great on the Mac, too.
Title: Re: Game Contest 2018
Post by: eny on January 09, 2018, 07:48:23 pm
Petris is great on the Mac, too.
Wauw nice.
Write once compile anywhere indeed ;)
Title: Re: Game Contest 2018
Post by: mrguzgog on January 14, 2018, 04:50:30 pm
I'd like to enter something - no idea what yet though!

I use Linux but do have access to a Windows machine so could maybe compile for the 97% of folk who use that OS. I'm looking for the easiest game library to use... I've dabbled with SDL (pointers - how quaint!) and Allegro (seems ok) but would like to look into SFML. Does anyone have experience of using this on Linux or cross-platform? I couldn't figure out where to start with it on Linux and asked in the general section of the forum but got no answers... https://forum.lazarus.freepascal.org/index.php/topic,39209.0.html

I don't really want the hassle of building any sort of installer - especially for Windows - is it possible to distribute a game as an executable alongside the necessary libraries and resources in a single folder if using any of the mentioned libs?
Title: Re: Game Contest 2018
Post by: lainz on January 14, 2018, 07:38:57 pm
Quote
I'd like to enter something - no idea what yet though!

There is enough time to think!

Quote
I don't really want the hassle of building any sort of installer - especially for Windows - is it possible to distribute a game as an executable alongside the necessary libraries and resources in a single folder if using any of the mentioned libs?

Sure, you can give just the executables and libraries used.
Title: Re: Game Contest 2018
Post by: mrguzgog on January 14, 2018, 09:03:17 pm
I think I'll stick with Allegro.pas after all, it seems to work just fine (although the instructions on the wiki http://wiki.freepascal.org/Allegro.pas_tutorial_0 aren't quite right/up to date for Linux). Time for some thinking while I cobble together a framework/state machine...
Title: Re: Game Contest 2018
Post by: Ñuño_Martínez on January 15, 2018, 10:46:39 am
I think I'll stick with Allegro.pas after all, it seems to work just fine (although the instructions on the wiki http://wiki.freepascal.org/Allegro.pas_tutorial_0 aren't quite right/up to date for Linux). Time for some thinking while I cobble together a framework/state machine...
I know documentation isn't complete but I'm still working on Allegro.pas.  Of course, I'll be glad to help answering any question here or at Pascal Game Development forum.
Title: Re: Game Contest 2018
Post by: turrican on January 15, 2018, 11:54:14 am
I think I'll stick with Allegro.pas after all, it seems to work just fine (although the instructions on the wiki http://wiki.freepascal.org/Allegro.pas_tutorial_0 aren't quite right/up to date for Linux). Time for some thinking while I cobble together a framework/state machine...

Allegro is strong and a very stable library and a large number of projects are made using this library. You cannot be wrong at this side-
Title: Re: Game Contest 2018
Post by: mrguzgog on January 15, 2018, 04:54:57 pm
I know documentation isn't complete but I'm still working on Allegro.pas.  Of course, I'll be glad to help answering any question here or at Pascal Game Development forum.
[/quote]

Well I do have a question you might be able to help with :D - how would I statically link so I could just distribute a single executable with assets etc? I tried fpc -k-static (as per this thread: http://forum.lazarus.freepascal.org/index.php?topic=15712.0) but it throws out an error message

Code: Pascal  [Select][+][-]
  1. /usr/bin/ld: cannot find -lallegro
  2.  

If I just compile and run my program normally everything works fine. I'm not too familiar with the compiling/linking business!

This probably isn't the right thread to ask this question so feel free to point me to the right place :D

@turrican Yes, I've used allegro before with C years ago, and D more recently but I'd prefer use Pascal.

Title: Re: Game Contest 2018
Post by: Ñuño_Martínez on January 16, 2018, 01:37:49 pm
I know documentation isn't complete but I'm still working on Allegro.pas.  Of course, I'll be glad to help answering any question here or at Pascal Game Development forum.

Well I do have a question you might be able to help with :D - how would I statically link so I could just distribute a single executable with assets etc? I tried fpc -k-static (as per this thread: http://forum.lazarus.freepascal.org/index.php?topic=15712.0) but it throws out an error message

Code: Pascal  [Select][+][-]
  1. /usr/bin/ld: cannot find -lallegro
  2.  

If I just compile and run my program normally everything works fine. I'm not too familiar with the compiling/linking business!
You need Allegro (http://liballeg.org/) development libraries (the ".a" ones) to compile it statically. It is possible, but Allegro.pas expects it dynamically linked so you'll need to modify Allegro.pas to accomplish it. I never tried so I have no idea how hard it can be.

This probably isn't the right thread to ask this question so feel free to point me to the right place :D
A new thread here or at PGD (http://www.pascalgamedevelopment.com/) should be the best option.  ::)
Title: Re: Game Contest 2018
Post by: mrguzgog on January 16, 2018, 03:27:30 pm
You need Allegro (http://liballeg.org/) development libraries (the ".a" ones) to compile it statically. It is possible, but Allegro.pas expects it dynamically linked so you'll need to modify Allegro.pas to accomplish it. I never tried so I have no idea how hard it can be.
I have the 'dev' libraries installed already and it doesn't work.

If I use the default dynamic linking, that means the user will have to install allegro themselves on Linux (not a big deal except the version in their repo may not be up to date) but what about on Windows - is an installer needed or can the libraries just be shipped in the application directory?

EDIT: I want to keep things as simple as possible so I can concentrate on the game  :D
Title: Re: Game Contest 2018
Post by: lainz on January 16, 2018, 06:01:13 pm
If I use the default dynamic linking, that means the user will have to install allegro themselves on Linux (not a big deal except the version in their repo may not be up to date)

linux is always like that, users must know how to install things

but what about on Windows - is an installer needed or can the libraries just be shipped in the application directory?

just copy the dll to the exe folder
Title: Re: Game Contest 2018
Post by: Ñuño_Martínez on January 17, 2018, 11:09:17 am
You need Allegro (http://liballeg.org/) development libraries (the ".a" ones) to compile it statically. It is possible, but Allegro.pas expects it dynamically linked so you'll need to modify Allegro.pas to accomplish it. I never tried so I have no idea how hard it can be.
I have the 'dev' libraries installed already and it doesn't work.
So, download sources and compile yourself.  Changing the CMAKE configuration you can build the libraries the way you want (static, dynamic, debugging, monolithic...) but you would need some time and tries to learn how to do what you want.

About the other questions, just what lainz said. ;)
Title: Re: Game Contest 2018
Post by: mrguzgog on January 17, 2018, 04:37:04 pm
Don't really have the time for learning how to reconfigure/recompile when I'm learning Allegro, re-learning Pascal and trying to figure out a game at the same time! :D I'll stick with dynamic linking ;)

I've just got my basic framework up and running with a simple menu implemented - good start but still no idea what I'll be making LOL. Need some advice on timing though.... new thread for that.

Title: Re: Game Contest 2018
Post by: Paul_ on January 19, 2018, 09:34:08 pm
This will be my "beautiful" retro entry :)

https://imgur.com/a/SeVyt
Title: Re: Game Contest 2018
Post by: lainz on January 20, 2018, 11:49:49 am
This will be my "beautiful" retro entry :)

https://imgur.com/a/SeVyt

Good :)
Title: Re: Game Contest 2018
Post by: mrguzgog on January 20, 2018, 01:19:13 pm
Does the 'modern game' have to be a remake of an old game just with modern graphics etc or does it encompass any type of game? I've got an idea but it's not based on an old game AFAIK.
Title: Re: Game Contest 2018
Post by: lainz on January 20, 2018, 01:27:12 pm
Does the 'modern game' have to be a remake of an old game just with modern graphics etc or does it encompass any type of game? I've got an idea but it's not based on an old game AFAIK.

Anything. I changed the rules so anyone can enter with his ideas.
Title: Re: Game Contest 2018
Post by: mrguzgog on January 20, 2018, 06:13:36 pm
Got some basic stuff up and running :- working menu (ignore lurid colours!), level generation and movement (ignore colours, place-holder graphics etc!) all thanks to Allegro.pas  ;)

It won't be called 'some game' (!) and I'm not sure exactly where it's going but I've got some ideas. Hopefully this will inspire others to make a start too :D
Title: Re: Game Contest 2018
Post by: Handoko on January 20, 2018, 06:22:24 pm
Wow, it looks great!
Title: Re: Game Contest 2018
Post by: Paul_ on January 23, 2018, 11:43:54 pm
Video time: https://www.youtube.com/watch?v=xup0lQd2F10

I'm trying to get some working "physics" but it's still bad  :)

And these marathon runners needs AI, is there a usable library (Behavior tree etc.)?




Title: Re: Game Contest 2018
Post by: lainz on January 24, 2018, 12:23:55 am
Looking Good =)
Title: Re: Game Contest 2018
Post by: mrguzgog on January 28, 2018, 03:09:29 pm
Got a little player sprite moving around, added very basic npc control, did some refactoring already, trying out a new editor (Atom). No idea what these graphics are supposed to represent or where its going.

@Paul_ : that's looks great!
Title: Re: Game Contest 2018
Post by: lainz on January 28, 2018, 03:20:29 pm
Atom or VS Code are really good, also your game is looking good =)
Title: Re: Game Contest 2018
Post by: mrguzgog on January 28, 2018, 08:30:51 pm
Atom or VS Code are really good, also your game is looking good =)

At the risk of going off-topic  :) the symbol browsers for Pascal seem to be broken in all the editors (Atom, VS Code, Geany and gEdit) on my system - they display only half the procedures and functions in most source files. I guess they all rely on ctags or something but I don't know enough about that to fix it.
Title: Re: Game Contest 2018
Post by: Handoko on January 28, 2018, 08:37:43 pm
You can try Lazarus IDE. It is a great IDE for FPC.
Title: Re: Game Contest 2018
Post by: mrguzgog on January 28, 2018, 08:57:43 pm
Yes, I've used it before for GUI apps. I've had some issues getting the latest version of fpc installed (the repo version is too old) and get the feeling that installing the sources and Lazarus now might break something!
Title: Re: Game Contest 2018
Post by: Lulu on January 28, 2018, 09:31:43 pm
Hello all ! I'm happy to know there is a game context this year !
I will try to participate
Thanks :)
Title: Re: Game Contest 2018
Post by: lainz on January 29, 2018, 02:43:54 pm
Atom or VS Code are really good, also your game is looking good =)

At the risk of going off-topic  :) the symbol browsers for Pascal seem to be broken in all the editors (Atom, VS Code, Geany and gEdit) on my system - they display only half the procedures and functions in most source files. I guess they all rely on ctags or something but I don't know enough about that to fix it.

I can't say, I've used it only for web, not Pascal.

Yes, I've used it before for GUI apps. I've had some issues getting the latest version of fpc installed (the repo version is too old) and get the feeling that installing the sources and Lazarus now might break something!

I think you will not have problems, everything in the newest Lazarus installer works fine.
Title: Re: Game Contest 2018
Post by: mrguzgog on January 29, 2018, 06:39:25 pm
Lazarus installed using fpcupdeluxe (thanks to Eugene Loza for help with that).

Got it all set up but forgot how annoying the MDI interface is and how only the editor can easily be 'themed' - no matter, I'm not opening up that debate. It works nicely so sticking with it for now. :D
Title: Re: Game Contest 2018
Post by: mrguzgog on January 29, 2018, 10:26:12 pm
A little more progress...

https://media.giphy.com/media/3o7WIv7S0ZRnGjs1DW/giphy.gif (https://media.giphy.com/media/3o7WIv7S0ZRnGjs1DW/giphy.gif)
Title: Re: Game Contest 2018
Post by: mrguzgog on January 30, 2018, 08:15:15 pm
Work in progress executable for anyone on a 64 bit linux with allegro 5.2 installed. Left/right cursor keys to turn, left control stop, esc to exit game or menu. At present the idea is to turn off the lights while the annoying little robot thing turns them back on! Number remaining bottom left, time in secs bottom right. Doesn't yet recognise once you've switched them all off or come up with a score or new level. If you hit the robot he'll disappear - will be factored in to score. Primitive graphics and sound atm, only runs in a 800x600 window atm and won't recognise window close event so esc to get out.

https://www.dropbox.com/s/wl0itlnsv49nvvj/annoying-game.tar.gz?dl=0

(Always scan for malware!)

Seems I've hijacked the thread  :P
Title: Re: Game Contest 2018
Post by: Paul_ on January 31, 2018, 04:02:51 am
Haha, great name, it looks fine and don't forget poor people with Windows later :)

Btw. my game is crashing on Linux even under WINE :)
Title: Re: Game Contest 2018
Post by: mrguzgog on January 31, 2018, 08:40:47 pm
Haha, great name, it looks fine and don't forget poor people with Windows later :)

Btw. my game is crashing on Linux even under WINE :)

Hehe, I'm not going to even think about compiling on Windows until it's finished  :)

What library or framework are you using?

I've now got 'levels' sorted and done some more tidying but it's still code-spaghetti in here  :o






Title: Re: Game Contest 2018
Post by: Paul_ on February 01, 2018, 01:16:41 am
I'm using SFML (https://github.com/DJMaster/csfml-fpc)

It will work after some code polishing. I just wonder why it's crashing WINE :)
Title: Re: Game Contest 2018
Post by: Eugene Loza on February 01, 2018, 07:07:15 am
I just wonder why it's crashing WINE :)
Because Wine is really no panacea :) And personally some time ago I found that my distro repository had a very outdated version of Wine, so I got the freshest version from the WineHQ and it worked better. Compare the version you're using with the upstream.
Title: Re: Game Contest 2018
Post by: Paul_ on February 01, 2018, 04:31:33 pm
Thanks for good tip, with actual version from winehq.org it's working.

I will try also native compilation.
Title: Re: Game Contest 2018
Post by: Paul_ on February 25, 2018, 11:33:05 pm
I made progress in my game and I'm not sure about this :)

- game world is 2D grid
- entities (enemy soldier for example) are in separated list
- for collision calcualtions every 2DGrid.TCell is holding list of entities (if entity is in TCell dimensions then TCell.List is resized)

Code: Pascal  [Select][+][-]
  1.   TCell = record
  2.     List : Array of PEntity; // List of entites which are in TCell dimensions
  3.     Items : Integer;
  4.     ..
  5.   end;
  6.  
  7.  TGrid2D = record
  8.     List : Array of array of TCell;
  9.     Count : Integer;  
  10.     ..
  11.   end;  
  12.  
  13.   PEntity = ^TEntity;
  14.   TEntity = record
  15.     ID : Integer;
  16.     Param : TEntityParameters;
  17.    ..
  18.   end;
  19.  
  20.   TEntityManager = record
  21.     Count : Integer;
  22.     List : array of PEntity; // List of all entities
  23.     ..
  24.   end;
  25.  

Collisions (entity vs terrain, entity vs projectile, projectile vs terrain) are based on 2D grid and it's fast.
Problematic part - when is entity moving and it passes from one TCell to next one, TCell.List must be updated in current and in previous TCells.

Code: Pascal  [Select][+][-]
  1.   procedure Entity_AssignToCell( Entity : PEntity );
  2.   begin
  3.     With Grid2D.list[ Entity.CurCell.x, Entity.CurCell.y ] do begin
  4.       inc( Items );
  5.       Setlength( List, Items );
  6.       List[ Items - 1 ] := Entity;
  7.     end;
  8.   end;
  9.  
  10.   procedure Entity_RemoveFromCell( Entity : PEntity );
  11.     var i    : Integer;
  12.         item : Integer;
  13.   begin
  14.    // item := -1;
  15.     With Grid2D.list[ entity.prevCell.x, entity.prevCell.y ] do begin
  16.  
  17.     for i := 0 to items - 1 do
  18.       if List[i].ID = Entity.ID then item := i;
  19.  
  20.       // if ( item < 0 ) or ( item = items ) then exit;
  21.  
  22.        List[item] := nil;
  23.        For i := item to items - 2 do
  24.          List[i] := List[ i + 1 ];
  25.  
  26.        dec( Items );
  27.        SetLength( List, Items );
  28.      end;
  29.   end;

Detection area can be something like 1x3 TCell for soldiers, for vehicles 8x4. It means update of 3 x 300 TCell.list every frame.
Isn't this repeated setlength too costly? There is a better solution?
Title: Re: Game Contest 2018
Post by: lainz on February 25, 2018, 11:49:19 pm
For me is wrong.

The entity should have the position in a property.

You should iterate the entities and display in the correct cell.
Title: Re: Game Contest 2018
Post by: Paul_ on February 26, 2018, 12:07:19 am
Iteration isn't good way if you have 1000 bullets and 1000 entities so it's 1 000 000 collision checks every frame.

In my implementation it's just 1000 checks (bullet vs TCell), it's something like spatial partition (https://conkerjo.wordpress.com/2009/06/13/spatial-hashing-implementation-for-fast-2d-collisions/).
Also I can get all needed objects on screen instead of iterate whole lists.

Problem is in dynamic array resizing (or not?). I'm not sure about this.
Title: Re: Game Contest 2018
Post by: lainz on February 26, 2018, 12:17:17 am
Iteration isn't good way if you have 1000 bullets and 1000 entities so it's 1 000 000 collision checks every frame.

In my implementation it's just 1000 checks, it's something like spatial partition (https://conkerjo.wordpress.com/2009/06/13/spatial-hashing-implementation-for-fast-2d-collisions/).
Also I can get all objects on screen instead of iterate whole lists.

Ok, I see.

Quote
Isn't this repeated setlength too costly? There is a better solution?

Well, try using FPObjectList / TFPList, I've used it recently instead of using Arrays.

The advantage is that is just a list of pointers as I can understand it, so it does not resize phisically the memory, just the list of pointers, and does it in an efficient way (doubling the memory and some kind of these tricks).
Title: Re: Game Contest 2018
Post by: Paul_ on February 26, 2018, 12:18:27 am
Thanks, I will check it.
Title: Re: Game Contest 2018
Post by: howardpc on February 26, 2018, 12:23:17 am
The EntityManager would be faster if you used TfpList to hold pointers to all your entities, rather than using a dynamic array.
Then you also get a built-in Count and enumerator.

It might be that sorting the list by ID could help locating entities if you only need to move a few at once. Then you could use a binary search for location, rather than (possibly) enumerating the entire list to find a particular entity.
Sometimes the only way to know for sure if some adaptation would improve performance is simply to implement it and see if it makes a difference in the right direction.
Title: Re: Game Contest 2018
Post by: Paul_ on February 26, 2018, 01:37:30 am
The EntityManager would be faster if you used TfpList to hold pointers to all your entities, rather than using a dynamic array.
..

EntityManager is list of pointers with memory allocation for records, it's probably done in similar way as TfpList.
I was more curious about TCell.List updates. Anyway, I must look at it and try more ways as you write.
Title: Re: Game Contest 2018
Post by: howardpc on February 26, 2018, 10:51:34 am
EntityManager is list of pointers with memory allocation for records, it's probably done in similar way as TfpList.

Implementing EntityManager as a dynamic array of pointers means you will spend time and resources reallocating and re-initialising the array with every SetLength required.
TFPList has a superior way of caching the underlying array of pointers, and if Capacity is set intelligently, it may not have to do any expensive memory reallocations at all.

Dynamic arrays have many advantages, including compiler management so no manual construction or destruction is needed, optimised enumeration with easy syntax and straightforward indexed  access to individual elements. But in situations where the array length changes frequently there is usually a performance degradation compared to some other more complex list implementations.
Title: Re: Game Contest 2018
Post by: Paul_ on February 26, 2018, 11:14:22 pm
I tested TFPList bit. Access is almost same or only few % worse than old code, up to 10% worse in quicksort, really better when entities are removed. CPU load seems same but I have no proper tools to measure it.

This is the fastest way how access the elements in TFPList?

Code: Pascal  [Select][+][-]
  1. Type
  2.   PItem = ^TItem;
  3.   TItem = record
  4.     x, y : integer;
  5.     ..
  6.   end;
  7.  
  8. Var
  9.   _FPLManager : TFPList
  10.  
  11. Procedure Test;
  12.   var i : Integer;
  13. begin
  14.   for i := 0 to _FPLManager.Count - 1 do
  15.     // with TItem( _FPLManager[i]^ ) do    //slower
  16.     with TItem(_FPLManager.List[ i ]^) do  //better
  17.        y := y + 10;
  18. end;
  19.  
Title: Re: Game Contest 2018
Post by: howardpc on February 27, 2018, 09:58:25 am
Code: Pascal  [Select][+][-]
  1. type
  2.   TItem = record
  3.     x, y: Integer;
  4.     ...
  5.   end;
  6.   PItem = ^TItem;
  7.  
  8. var
  9.   _FPLManager: TFPList; // list of PItem
  10.  
  11. procedure TestIncAllYBy(anIncValue: Integer);
  12. var
  13.   pi: PITem;
  14. begin
  15.   for pi in _FPLManager do
  16.     Inc(pi^.y, anIncValue);
  17. end;
Title: Re: Game Contest 2018
Post by: Paul_ on February 27, 2018, 12:19:46 pm
Hm, it's slower:

Quote
// Your code
ACCESS - TEST: [1000 items]
TPFList:  0,0186982405558806 ms

ACCESS - TEST: [1000000 items]
TPFList:  29,1471465876548 ms

// My code
ACCESS - TEST: [1000 items]
TPFList:  0,00572563366190435 ms

ACCESS - TEST: [1000000 items]
TPFList:  19,3333494243441 ms

Full results: (Array vs Array of Pointers vs TFPList)
It needs some dynamic test also (add/remove), maybe later.

Code: Pascal  [Select][+][-]
  1.   PItem = ^TItem;
  2.   TItem = record
  3.     ID         : integer;
  4.     x, y       : integer;
  5.     Name       : String[80];
  6.     angle      : double;
  7.     alpha      : byte;
  8.     components : array [0..9] of integer;
  9.     p          : pointer;
  10.   end;
  11.  
  12.  
  13. ------- BENCHMARK WITH: [1000 items] ----------
  14. CREATE AND FILL - TEST: [1000 items]
  15. Array:    0,194234492909235 ms
  16. ArrayPtr: 0,331163778283136 ms
  17. TPFList:  0,291653345719301 ms
  18.  
  19. QUICKSORT - TEST: [1000 items]
  20. Array:    0,833338360105924 ms
  21. ArrayPtr: 0,0645437600661121 ms
  22. TPFList:  0,0687662490423998 ms
  23.  
  24. ACCESS - TEST: [1000 items]
  25. Array:    0,0138738923506596 ms
  26. ArrayPtr: 0,00482570168718595 ms
  27. TPFList:  0,0135722859952105 ms
  28.  
  29. FREE MEM - TEST: [1000 items]
  30. Array:    0,00482570168718595 ms
  31. ArrayPtr: 0,0226204766586842 ms
  32. TPFList:  0,0735919507295858 ms
  33.  
  34. End of benchmark.
  35.  
  36.  
  37. ------- BENCHMARK WITH: [10000 items] ----------
  38. CREATE AND FILL - TEST: [10000 items]
  39. Array:    0,497994190067783 ms
  40. ArrayPtr: 0,756012918979713 ms
  41. TPFList:  0,802323972886983 ms
  42.  
  43. QUICKSORT - TEST: [10000 items]
  44. Array:    2,47613777839259 ms
  45. ArrayPtr: 0,873294159394227 ms
  46. TPFList:  0,928626847179536 ms
  47.  
  48. ACCESS - TEST: [10000 items]
  49. Array:    0,0303728340560664 ms
  50. ArrayPtr: 0,039093746804838 ms
  51. TPFList:  0,0327786030902103 ms
  52.  
  53. FREE MEM - TEST: [10000 items]
  54. Array:    0,0448074482609297 ms
  55. ArrayPtr: 0,826983105486958 ms
  56. TPFList:  0,673314608431018 ms
  57.  
  58. End of benchmark.
  59.  
  60.  
  61. ------- BENCHMARK WITH: [50000 items] ----------
  62. CREATE AND FILL - TEST: [50000 items]
  63. Array:    10,8603071577652 ms
  64. ArrayPtr: 7,40538551556901 ms
  65. TPFList:  6,97137135204913 ms
  66.  
  67. QUICKSORT - TEST: [50000 items]
  68. Array:    21,7052322986162 ms
  69. ArrayPtr: 6,7137979707802 ms
  70. TPFList:  5,92750545910796 ms
  71.  
  72. ACCESS - TEST: [50000 items]
  73. Array:    0,645139885871467 ms
  74. ArrayPtr: 0,644536669521891 ms
  75. TPFList:  0,655997780163834 ms
  76.  
  77. FREE MEM - TEST: [50000 items]
  78. Array:    1,05623182810747 ms
  79. ArrayPtr: 6,7563247234253 ms
  80. TPFList:  5,35143384526294 ms
  81.  
  82. End of benchmark.
  83.  
  84.  
  85. ------- BENCHMARK WITH: [100000 items] ----------
  86. CREATE AND FILL - TEST: [100000 items]
  87. Array:    21,0872009428758 ms
  88. ArrayPtr: 12,4165413216539 ms
  89. TPFList:  10,7357626653725 ms
  90.  
  91. QUICKSORT - TEST: [100000 items]
  92. Array:    32,6069853595016 ms
  93. ArrayPtr: 14,6100539259867 ms
  94. TPFList:  14,8843560381129 ms
  95.  
  96. ACCESS - TEST: [100000 items]
  97. Array:    1,30579862607799 ms
  98. ArrayPtr: 1,65425273774608 ms
  99. TPFList:  1,67294145307776 ms
  100.  
  101. FREE MEM - TEST: [100000 items]
  102. Array:    2,1742210272162 ms
  103. ArrayPtr: 13,5324384854906 ms
  104. TPFList:  13,8579838493328 ms
  105.  
  106. End of benchmark.
  107.  
  108.  
  109. ------- BENCHMARK WITH: [1000000 items] ----------
  110. CREATE AND FILL - TEST: [1000000 items]
  111. Array:    60,415382811725 ms
  112. ArrayPtr: 63,9610770252843 ms
  113. TPFList:  62,4727572244083 ms
  114.  
  115. QUICKSORT - TEST: [1000000 items]
  116. Array:    407,911151726854 ms
  117. ArrayPtr: 229,015171783549 ms
  118. TPFList:  239,287614569962 ms
  119.  
  120. ACCESS - TEST: [1000000 items]
  121. Array:    15,8138863754558 ms
  122. ArrayPtr: 19,8080906158596 ms
  123. TPFList:  19,2973543319395 ms
  124.  
  125. FREE MEM - TEST: [1000000 items]
  126. Array:    22,1558542282291 ms
  127. ArrayPtr: 186,838695713603 ms
  128. TPFList:  184,151844091662 ms
  129.  
  130. End of benchmark.
  131.  
Title: Re: Game Contest 2018
Post by: howardpc on February 27, 2018, 08:45:08 pm
Well, I take back most of what I wrote earlier.
A simple dynamic array of TItem performs better than TFPList in every test except QuickSort, where TFPList is still consistently better in my tests, though only by a small margin. I tested with -O3 optimisation.
I could not get on with your test program, which was too 'procedural' for me to follow easily, so I did my own version which is a bit more object oriented. I think the algorithm comparison is identical, however. Attached for completeness.
Going for iterations much above 10,000,000 gave me heap overflow errors (or locked up my machine).

Typical output is as follows:

------- BENCHMARK with 1000 items ----------

CREATE AND FILL - TEST: [1000 items]
DynArray of TItem: 0.089 ms
  DynArray of PItem: 0.12 ms
    TPFList of PItem:  0.124 ms

ACCESS - TEST: [1000 items]
DynArray of TItem: 0.007 ms
  DynArray of PItem: 0.008 ms
    TPFList of PItem:  0.013 ms

QUICKSORT - TEST: [1000 items]
DynArray of TItem: 0.344 ms
  DynArray of PItem: 0.181 ms
    TPFList of PItem:  0.173 ms

FINALIZATION - TEST: [1000 items]
DynArray of TItem: 0.018 ms
  DynArray of PItem: 0.043 ms
    TPFList of PItem:  0.08 ms

------- BENCHMARK with 10000 items ----------

CREATE AND FILL - TEST: [10000 items]
DynArray of TItem: 1.089 ms
  DynArray of PItem: 1.103 ms
    TPFList of PItem:  1.158 ms

ACCESS - TEST: [10000 items]
DynArray of TItem: 0.082 ms
  DynArray of PItem: 0.07 ms
    TPFList of PItem:  0.13 ms

QUICKSORT - TEST: [10000 items]
DynArray of TItem: 4.371 ms
  DynArray of PItem: 2.322 ms
    TPFList of PItem:  2.027 ms

FINALIZATION - TEST: [10000 items]
DynArray of TItem: 0.258 ms
  DynArray of PItem: 0.786 ms
    TPFList of PItem:  0.87 ms

------- BENCHMARK with 50000 items ----------

CREATE AND FILL - TEST: [50000 items]
DynArray of TItem: 3.195 ms
  DynArray of PItem: 5.109 ms
    TPFList of PItem:  5.08 ms

ACCESS - TEST: [50000 items]
DynArray of TItem: 0.808 ms
  DynArray of PItem: 0.941 ms
    TPFList of PItem:  1.289 ms

QUICKSORT - TEST: [50000 items]
DynArray of TItem: 21.935 ms
  DynArray of PItem: 12.674 ms
    TPFList of PItem:  10.96 ms

FINALIZATION - TEST: [50000 items]
DynArray of TItem: 0.619 ms
  DynArray of PItem: 8.389 ms
    TPFList of PItem:  8.727 ms

------- BENCHMARK with 1000000 items ----------

CREATE AND FILL - TEST: [1000000 items]
DynArray of TItem: 43.389 ms
  DynArray of PItem: 52.806 ms
    TPFList of PItem:  46.093 ms

ACCESS - TEST: [1000000 items]
DynArray of TItem: 14.524 ms
  DynArray of PItem: 15.844 ms
    TPFList of PItem:  20.588 ms

QUICKSORT - TEST: [1000000 items]
DynArray of TItem: 323.348 ms
  DynArray of PItem: 261.171 ms
    TPFList of PItem:  244.879 ms

FINALIZATION - TEST: [1000000 items]
DynArray of TItem: 5.788 ms
  DynArray of PItem: 199.68 ms
    TPFList of PItem:  205.156 ms

------- BENCHMARK with 10000000 items ----------

CREATE AND FILL - TEST: [10000000 items]
DynArray of TItem: 381.413 ms
  DynArray of PItem: 447.635 ms
    TPFList of PItem:  446.729 ms

ACCESS - TEST: [10000000 items]
DynArray of TItem: 115.339 ms
  DynArray of PItem: 129.613 ms
    TPFList of PItem:  194.798 ms

QUICKSORT - TEST: [10000000 items]
DynArray of TItem: 3865.828 ms
  DynArray of PItem: 4271.55 ms
    TPFList of PItem:  4109.075 ms

FINALIZATION - TEST: [10000000 items]
DynArray of TItem: 57.777 ms
  DynArray of PItem: 2344.408 ms
    TPFList of PItem:  2457.059 ms

Title: Re: Game Contest 2018
Post by: Paul_ on February 27, 2018, 10:54:01 pm
Your code have way better structure and FPListQSort code is completely out of my imagination. I must check some things more close.

Anyway, "for pi in pitemFPList do" instead of "pitemFPList.List[ i ]". Why use this slower way? It makes biggest difference in benchmark.
Title: Re: Game Contest 2018
Post by: howardpc on February 28, 2018, 12:03:07 am
Anyway, "for pi in pitemFPList do" instead of "pitemFPList.List[ i ]". Why use this slower way? It makes biggest difference in benchmark.

I assumed (without testing) that using the built-in enumerator would be fast. Perhaps its main value is just syntax sugar. I'm sure you can optimise my code at points, and perhaps alter the comparison results significantly.
Title: Re: Game Contest 2018
Post by: Edson on March 17, 2018, 03:37:39 am
I'm playing with SDL2. It's good  :D. But I don't like it needs external *.dll. I'm testing on Windows, I hope no problems in Linux.

I am triying to remember my old Commodore 64 games. I lost them. 

This is my first screen.
Title: Re: Game Contest 2018
Post by: Edson on March 19, 2018, 03:32:47 am
Some disappointed with SDL2. Rendering with SDL_RenderDrawPoints() is as slow as using SDL_RenderDrawPoint() (And I don't get this works properly http://forum.lazarus.freepascal.org/index.php/topic,40526.msg280031/topicseen.html#new ).
It gives me just 15 FPS in my Corei7 3.4GHz - RAM 8GB.  :-[
Title: Re: Game Contest 2018
Post by: lainz on March 19, 2018, 01:01:14 pm
Some disappointed with SDL2. Rendering with SDL_RenderDrawPoints() is as slow as using SDL_RenderDrawPoint() (And I don't get this works properly http://forum.lazarus.freepascal.org/index.php/topic,40526.msg280031/topicseen.html#new ).
It gives me just 15 FPS in my Corei7 3.4GHz - RAM 8GB.  :-[

Is like drawing a single pixel?
Title: Re: Game Contest 2018
Post by: Ñuño_Martínez on March 19, 2018, 06:12:25 pm
Some disappointed with SDL2. Rendering with SDL_RenderDrawPoints() is as slow as using SDL_RenderDrawPoint() (And I don't get this works properly http://forum.lazarus.freepascal.org/index.php/topic,40526.msg280031/topicseen.html#new ).
It gives me just 15 FPS in my Corei7 3.4GHz - RAM 8GB.  :-[
Use Allegro.pas.  ;D

Just kidding (nope).  I'm pretty sure there is a "bitmap lock" function in SDL (as it is in Allegro (http://allegro-pas.sourceforge.net/docs/5.2/lib/Allegro5.html#al_lock_bitmap)) that should speed up bitmap access.  Just look for it.
Title: Re: Game Contest 2018
Post by: Edson on March 19, 2018, 10:18:02 pm
Some disappointed with SDL2. Rendering with SDL_RenderDrawPoints() is as slow as using SDL_RenderDrawPoint() (And I don't get this works properly http://forum.lazarus.freepascal.org/index.php/topic,40526.msg280031/topicseen.html#new ).
It gives me just 15 FPS in my Corei7 3.4GHz - RAM 8GB.  :-[

Is like drawing a single pixel?

Yes. Using SDL_RenderDrawPoints() with an array of Pixels is as slow as drawing each pixel with SDL_RenderDrawPoint(). It's supposed to be faster.
Title: Re: Game Contest 2018
Post by: Paul_ on March 19, 2018, 11:24:00 pm
You can check their documentation, there is no mention how it's done and if it's faster or not - https://wiki.libsdl.org/SDL_RenderDrawPoints#Syntax
Then you have to look at the source codes.

Btw. best documented framework is probably SFML:
https://www.sfml-dev.org/tutorials/2.4/graphics-vertex-array.php
https://www.sfml-dev.org/documentation/2.4.2/classsf_1_1VertexArray.php
Title: Re: Game Contest 2018
Post by: Edson on March 20, 2018, 09:57:29 pm
Well I read some post where suggest to use RenderDrawPoints() instead RenderDrawPoint() to a better perfomance. No matter.
I see there is a lack of documentation for SDL using Free Pascal (I only see the https://www.freepascal-meets-sdl.net/).
Is there a Wiki for that? Maybe I can collaborate, now I'm starting using SDL2.
Title: Re: Game Contest 2018
Post by: lainz on March 22, 2018, 07:00:50 pm
And your application code is slower than drawing with TCanvas on a regular Form?

If not, at least is not that slow =)
Title: Re: Game Contest 2018
Post by: Edson on March 23, 2018, 06:12:21 pm
And your application code is slower than drawing with TCanvas on a regular Form?

If not, at least is not that slow =)
That was the question I was doing too. I wanted to do a comparison, but after improving the performance of my program I forgot. I will try to compare just for information.

Cuurently I'm not doing RenderDrawPoints() or RenderDrawPoint(). They are too slow in SDL2. I'm working with textures now and I get 128 FPS.
Title: Re: Game Contest 2018
Post by: Ñuño_Martínez on March 26, 2018, 11:44:33 am
I think you should open another thread to discuss that, shouldn't you?

On-topic:  There's a game programming contest at the end of the month. The idea is to resurrect an old project. I'll try to participate, so may be we'll have a new game.
Title: Re: Game Contest 2018
Post by: Paul_ on March 26, 2018, 06:25:53 pm
Which one?

20.4. - starts LUDUM DARE 41
I will participate for the second time. My simple SFML "engine" is now more prepared (also thanks to this topic contest) but it still miss sprite animation system (something like Spine) and 2D physics engine (Chipmunk, Box2D).

There is one global minor problem with all game jams, people are lazy download game files.
They prefer to run them via browser (Unity, html5, Java, Godot), which is logical :)
Title: Re: Game Contest 2018
Post by: lainz on March 26, 2018, 10:00:36 pm
Which one?

Yes, we want to know =)


There is one global minor problem with all game jams, people are lazy download game files.
They prefer to run them via browser (Unity, html5, Java, Godot), which is logical :)

A downloader UI can do the trick, just download a small .exe (few kb) that gives you a nice downloader, that works also as menu to launch, for each project.

That way is the way, say it to Steam =)
Title: Re: Game Contest 2018
Post by: Paul_ on March 27, 2018, 10:38:02 pm
A downloader UI can do the trick, just download a small .exe (few kb) that gives you a nice downloader, that works also as menu to launch, for each project.

Don't trust any downloader! Never :)

*.exe files are blocked by browsers, security programs + firewall in case of downloader. So user get 3x warning which increase paranoia :)

I dont like installers for small apps or games, just packages like rar or zip are fine.
Title: Re: Game Contest 2018
Post by: Ñuño_Martínez on March 28, 2018, 06:57:12 pm
Which one?

Yes, we want to know =)
They called it "Resurrection Hack (https://tins.amarillion.org/resu18/rules/)".  It is an Allegro jam, and you see it is quite improvised.
Title: Re: Game Contest 2018
Post by: MSABC on March 29, 2018, 08:20:34 pm
Hi together,

as a newby i like to give it a stupid try:

It's somehow stupid, bit I like the lively behaviour created by almost neglicable program code.

see:
https://github.com/GitHub4MS/TMSCG

( and, as a newby, I have do discover how to handle GitHub  O:-)  )

regards MSABC
Title: Re: Game Contest 2018
Post by: lainz on March 31, 2018, 03:37:22 am
Thanks for your submission, I will find time to try and then add to the first post as an entry, I don't know if it's a classic game or a moder game, so I can't add it now.

Edit:

This maybe is interesting for someone to make animations: Animating with easings
https://www.getlazarus.org/forums/viewtopic.php?t=39
Title: Re: Game Contest 2018
Post by: lainz on March 31, 2018, 03:40:23 am
A downloader UI can do the trick, just download a small .exe (few kb) that gives you a nice downloader, that works also as menu to launch, for each project.

Don't trust any downloader! Never :)

*.exe files are blocked by browsers, security programs + firewall in case of downloader. So user get 3x warning which increase paranoia :)

I dont like installers for small apps or games, just packages like rar or zip are fine.

App Store? Google Play? =)

Never is not the word, but depends from where you grabbed the downloader.

Or these are that bad really... maybe yes.

Online Package Manager is a downloader also. It downloads the sources and then compiles them, but I think it can be trusted (except for the update from developer site button)...

Maybe an OPM for sample projects will be good.
Title: Re: Game Contest 2018
Post by: Lulu on March 31, 2018, 09:30:03 pm
Very interesting, thanks Lainz ! :)
Title: Re: Game Contest 2018
Post by: lainz on March 31, 2018, 10:49:35 pm
Very interesting, thanks Lainz ! :)

You're welcome. Just need to share such good and easy to do things  :)
Title: Re: Game Contest 2018
Post by: Lulu on April 02, 2018, 11:44:04 pm
Hello :)

I made a game for the contest: 'Fire Wire'.

It consists in finding the points of a drawing in the right order. The direction of the next point is indicated by a line on the mouse cursor.
It's a peaceful game: no kill, no violence, ideal for children. Actually there are 20 levels created with a level editor specially made for the game.

It use TOpenGLContext and BGRABitmap for graphics, and OpenAL for sound. If OpenAL is not installed on your system, there is no sound but game will work.

Compiled on Win10. Please can anyone compile and test it on Linux and Mac ?

Thanks in advance for testing it ! :)

Latest version  http://forum.lazarus.freepascal.org/index.php/topic,39495.msg285670.html#msg285670 (http://forum.lazarus.freepascal.org/index.php/topic,39495.msg285670.html#msg285670)
Title: Re: Game Contest 2018
Post by: lainz on April 03, 2018, 12:26:07 am
Nice!

I like that kind of games, I'm bad at FPS also, plus I'm graphic designer and drawing is always welcomed!

Edit: Works fine on Windows. Is relaxing.
Title: Re: Game Contest 2018
Post by: Ñuño_Martínez on April 03, 2018, 10:35:32 am
Last weekend was "Resurrection Hack (https://tins.amarillion.org/resu18/)"  and I did an entry.  It isn't finished yet but I plan to do it and upload in to GameJolt or Itch.io.  If you want to give a try to the demo, download this (https://tins.amarillion.org/upload/spacebattleRH2018-180402-src-pas_yGsVJ13.zip).
Title: Re: Game Contest 2018
Post by: turrican on April 03, 2018, 11:35:56 am
Hello :)

I made a game for the contest: 'Fire Wire'.

It consists in finding the points of a drawing in the right order. The direction of the next point is indicated by a line on the mouse cursor.
It's a peaceful game: no kill, no violence, ideal for children. Actually there are 20 levels created with a level editor specially made for the game.

It use TOpenGLContext and BGRABitmap for graphics, and OpenAL for sound. If OpenAL is not installed on your system, there is no sound but game will work.

Compiled on Win10. Please can anyone compile and test it on Linux and Mac ?

Thanks in advance for testing it ! :)

Source : www.lulutech.fr/Logitheque/FireWire/FireWireGameSrc.7z (http://www.lulutech.fr/Logitheque/FireWire/FireWireGameSrc.7z)
Executable for Windows www.lulutech.fr/Logitheque/FireWire/FireWireGame_WinExe.7z (http://www.lulutech.fr/Logitheque/FireWire/FireWireGame_WinExe.7z)

Impressive!
Title: Re: Game Contest 2018
Post by: Paul_ on April 03, 2018, 01:38:52 pm
@Lulu nice game, but I got some memory leaks and exception error when I closed the game (Windows).
Title: Re: Game Contest 2018
Post by: Lulu on April 03, 2018, 02:31:16 pm
Thanks to test :)
Yes, there are 6 blocks not freed at the end of the game and I don't understand why... I try to resolve this problem since few days... %)

I think the exception may appear because of the way I chose to darken the scene before closing the window. I will try another way.

Title: Re: Game Contest 2018
Post by: tr_escape on April 03, 2018, 02:34:09 pm
In win7 it is working but I haven't got Openal I tested for gaming only.

I'll try in Linux mint too at home.
Title: Re: Game Contest 2018
Post by: lainz on April 06, 2018, 05:24:16 am
Waves, is like an experience more than a game, or a painting with water game  :)

100% tweak aware! With constants  8)
Title: Re: Game Contest 2018
Post by: circular on April 06, 2018, 12:36:34 pm
Very artistic lainz  :)
Title: Re: Game Contest 2018
Post by: josh on April 06, 2018, 12:42:48 pm
Just downloaded Lainz Wave Demo.
Tested on Windows 10, so much bright lights flickering like mad, be cautious if your sensitive to this, I suspect a bug, so a fix needed v quick......
Title: Re: Game Contest 2018
Post by: lainz on April 06, 2018, 01:15:02 pm
Very artistic lainz  :)

Thankyou =)

Just downloaded Lainz Wave Demo.
Tested on Windows 10, so much bright lights flickering like mad, be cautious if your sensitive to this, I suspect a bug, so a fix needed v quick......

Wow, is like that? Or flickering is a bug? Maybe is a bug, try setting DoubleBuffered:=True OnCreate event.
Title: Re: Game Contest 2018
Post by: josh on April 06, 2018, 01:27:07 pm

Adding doublebuffered to oncreate event does solve the problem:)

attached video of the issue; this is recorded at slower refresh rate to get to fit attachment; the flickering without doublebuffering was drastically worse than the video show.

video is mp4 zipped into zip
Title: Re: Game Contest 2018
Post by: Lulu on April 06, 2018, 02:08:24 pm
good project Lainz, full colors !
Title: Re: Game Contest 2018
Post by: lainz on April 08, 2018, 03:41:50 pm
good project Lainz, full colors !

Thanks =)

Obviously it's not a game, and I can't participate, since I'm the organizer of the contest  :)

Adding doublebuffered to oncreate event does solve the problem:)

Yes, that happens on Windows, with themes not enabled, but on Windows 10 you can't disable themes, so what's the real problem?  :'(
Title: Re: Game Contest 2018
Post by: lainz on April 14, 2018, 09:40:40 pm
Hi all, we already have 4 games (3 with sources) and 3 demos (these demos doesn't enter in the contest, 2 by me and one of my demos ported to another library by @turrican). See first post for the list.

Also there are some unfinished games we don't know too much abouth them. Any sort of progress?

We're in April, we have more than 3 months to finish this contest.

And maybe in the other half of the year we get back into the traditional Graphics Contest.
Title: Re: Game Contest 2018
Post by: Paul_ on April 15, 2018, 01:13:10 am
I will finish my game to the deadline.

Btw. 20.4. starts Ludum Dare 41 - https://ldjam.com/
Title: Re: Game Contest 2018
Post by: lainz on April 15, 2018, 03:22:25 pm
I will finish my game to the deadline.

Btw. 20.4. starts Ludum Dare 41 - https://ldjam.com/

Cool.  :)
Title: Re: Game Contest 2018
Post by: Handoko on May 07, 2018, 04:06:22 pm
I made a game for the contest: 'Fire Wire'.
...
Compiled on Win10. Please can anyone compile and test it on Linux and Mac ?

I can't compile it on Lazarus 1.8.0 64-bit Gtk2 Linux FPC 3.0.4. I got an compile time error:
OGLCScene.pas(31,3) Fatal: Cannot find UTF8Utils used by OGLCScene.

Where can I get UTF8Utils?
Title: Re: Game Contest 2018
Post by: lainz on May 07, 2018, 07:03:34 pm
I made a game for the contest: 'Fire Wire'.
...
Compiled on Win10. Please can anyone compile and test it on Linux and Mac ?

I can't compile it on Lazarus 1.8.0 64-bit Gtk2 Linux FPC 3.0.4. I got an compile time error:
OGLCScene.pas(31,3) Fatal: Cannot find UTF8Utils used by OGLCScene.

Where can I get UTF8Utils?

Compiled on 1.8.2 Windows, and works fine.

Edit: That file comes with the game sources, units\UTF8utils.pas

But it's mixed case, maybe on Linux the IDE or Compiler can't find that.. Just try renaming it or changing the case in uses.

UTF8Utils <> UTF8utils
Title: Re: Game Contest 2018
Post by: Handoko on May 08, 2018, 01:49:50 am
@lainz
Thank you, yes that was the problem.


I managed to make it compilable on Linux, with these changes:

=== OGLCScene.pas Line #31 (in uses clause)

Wrong:
UTF8Utils

Correct:
UTF8utils

=== common.pas Line #26..#30 (in const declaration)

Wrong:
PARTICLES_FOLDER = 'DATA'+DIRECTORYSEPARATOR+'Particles'+DIRECTORYSEPARATOR;
IMAGES_FOLDER = 'DATA'+DIRECTORYSEPARATOR+'Images'+DIRECTORYSEPARATOR;
DRAWINGS_FOLDER = 'DATA'+DIRECTORYSEPARATOR+'Drawings'+DIRECTORYSEPARATOR;
AUDIO_FOLDER = 'DATA'+DIRECTORYSEPARATOR+'Audio'+DIRECTORYSEPARATOR;
SCENARIO_FOLDER = 'DATA'+DIRECTORYSEPARATOR+'Scenario'+DIRECTORYSEPARATOR;

Correct:
PARTICLES_FOLDER = 'Data'+DIRECTORYSEPARATOR+'Particles'+DIRECTORYSEPARATOR;
IMAGES_FOLDER = 'Data'+DIRECTORYSEPARATOR+'Images'+DIRECTORYSEPARATOR;
DRAWINGS_FOLDER = 'Data'+DIRECTORYSEPARATOR+'Drawings'+DIRECTORYSEPARATOR;
AUDIO_FOLDER = 'Data'+DIRECTORYSEPARATOR+'Audio'+DIRECTORYSEPARATOR;
SCENARIO_FOLDER = 'Data'+DIRECTORYSEPARATOR+'Scenario'+DIRECTORYSEPARATOR;
Title: Re: Game Contest 2018
Post by: Ñuño_Martínez on May 08, 2018, 10:29:32 am
I made a game for the contest: 'Fire Wire'.
...
Compiled on Win10. Please can anyone compile and test it on Linux and Mac ?

I can't compile it on Lazarus 1.8.0 64-bit Gtk2 Linux FPC 3.0.4. I got an compile time error:
OGLCScene.pas(31,3) Fatal: Cannot find UTF8Utils used by OGLCScene.

Where can I get UTF8Utils?

Compiled on 1.8.2 Windows, and works fine.

Edit: That file comes with the game sources, units\UTF8utils.pas

But it's mixed case, maybe on Linux the IDE or Compiler can't find that.. Just try renaming it or changing the case in uses.

UTF8Utils <> UTF8utils
That shouldn't be the solution.  I mean, AFAIK FPC is case insensitive when looking for units so it should find "utf8utils" despite the letter casing and the operating system.  May be you configured the project in a way it is case sensitive?  I'm not sure it is possible though.
Title: Re: Game Contest 2018
Post by: Pascal on May 08, 2018, 12:12:42 pm
Adding doublebuffered to oncreate event does solve the problem:)

Yes, that happens on Windows, with themes not enabled, but on Windows 10 you can't disable themes, so what's the real problem?  :'(

For me too, or use Paint instead of Invalidate in OnTimer-Event.
Title: Re: Game Contest 2018
Post by: Handoko on May 08, 2018, 12:38:21 pm
I mean, AFAIK FPC is case insensitive when looking for units so it should find "utf8utils" despite the letter casing and the operating system.  May be you configured the project in a way it is case sensitive?  I'm not sure it is possible though.

Linux is case sensitive, your suggestion that FPC should find the lower case sounds a solution. But it is not a good solution. I personally prefer CamelCase instead of lower case. For example:
sysexecutable.pas vs SysExecutable.pas
Title: Re: Game Contest 2018
Post by: User137 on May 08, 2018, 02:33:56 pm
For me too, or use Paint instead of Invalidate in OnTimer-Event.
What i do in nxPascal demos is initialize graphics in form's onPaint event directly, and then disable the onPaint from triggering again. Then you don't need code in onCreate or a separate timer.
Title: Re: Game Contest 2018
Post by: Ñuño_Martínez on May 09, 2018, 01:52:38 pm
I mean, AFAIK FPC is case insensitive when looking for units so it should find "utf8utils" despite the letter casing and the operating system.  May be you configured the project in a way it is case sensitive?  I'm not sure it is possible though.

Linux is case sensitive, your suggestion that FPC should find the lower case sounds a solution. But it is not a good solution. I personally prefer CamelCase instead of lower case. For example:
sysexecutable.pas vs SysExecutable.pas
My filenames are always in lowercase, my UNIT names are CamelCase though.  And they work both Linux and Windows.  That's why I asked.  :o
Title: Re: Game Contest 2018
Post by: Lulu on May 11, 2018, 03:37:26 pm
About FireAndWire game,I removed the 'UTF8Util.pas' dependency because this unit is no longer used by the framework. :-[

Thanks Handoko for corrections to the code. I fixed them. I apologize for these case sensitives redundant errors ... Maybe I should install a version of linux on my computer ...

As the game is quite long and repetitive, I added an automatic backup by player and level, and the choice between 5 languages (I use google traduction for italian, spanish and english...). Now the game has 32 levels.

Latest version of the code:  www.lulutech.fr/Logitheque/FireWire/FireWireGameSrc.7z (http://www.lulutech.fr/Logitheque/FireWire/FireWireGameSrc.7z)
Compiled version for Windows:  www.lulutech.fr/Logitheque/FireWire/FireAndWire.zip (http://www.lulutech.fr/Logitheque/FireWire/FireAndWire.zip)

The new title screen for the game:

Title: Re: Game Contest 2018
Post by: Handoko on May 12, 2018, 10:43:05 am
Did you use any language feature that require FPC version above 3.0.4? It fails to compile on my Lazarus 1.8.0 64-bit Gtk2 FPC 3.0.4 Linux.
Title: Re: Game Contest 2018
Post by: Lulu on May 12, 2018, 03:42:06 pm
@Handoko, these lines are used to initialize the values of a constant record, here, the value for the default font.
I take a look on TBGRAPixel definition in TBGRABitmap library and its fields are defined :
Code: Pascal  [Select][+][-]
  1.     {$IFDEF BGRABITMAP_RGBAPIXEL}
  2.     red, green, blue, alpha: byte;
  3.     {$ELSE}
  4.     blue, green, red, alpha: byte;
  5.     {$ENDIF}
  6.  

So, with the line below, it will normaly work for you
Code: Pascal  [Select][+][-]
  1. const
  2. {$IFDEF BGRABITMAP_RGBAPIXEL}
  3. DefaultFont: TGuiFont=( FontName:''; FontHeight:12; Style:[];FontColor:(red:255;green:255;blue:255;alpha:255);
  4.                         OutLineColor:(red:0;green:0;blue:0;alpha:0); OutLineWidth: 1.0;
  5.                         ShadowColor:(red:0;green:0;blue:0;alpha:0); ShadowOffsetX:0;
  6.                         ShadowOffsetY:0; ShadowRadius:0);
  7. {$ELSE}
  8. DefaultFont: TGuiFont=( FontName:''; FontHeight:12; Style:[];FontColor:(blue:255;green:255;red:255;alpha:255);
  9.                         OutLineColor:(blue:0;green:0;red:0;alpha:0); OutLineWidth: 1.0;
  10.                         ShadowColor:(blue:0;green:0;red:0;alpha:0); ShadowOffsetX:0;
  11.                         ShadowOffsetY:0; ShadowRadius:0);
  12. {$ENDIF}
  13.  
Fixed in the source code, Thanks Handoko :)
Title: Re: Game Contest 2018
Post by: Handoko on May 17, 2018, 06:04:00 am
Code: Pascal  [Select][+][-]
  1. const
  2. {$IFDEF BGRABITMAP_RGBAPIXEL}
  3. DefaultFont: TGuiFont=( FontName:''; FontHeight:12; Style:[];FontColor:(red:255;green:255;blue:255;alpha:255);
  4.                         OutLineColor:(red:0;green:0;blue:0;alpha:0); OutLineWidth: 1.0;
  5.                         ShadowColor:(red:0;green:0;blue:0;alpha:0); ShadowOffsetX:0;
  6.                         ShadowOffsetY:0; ShadowRadius:0);
  7. {$ELSE}
  8. DefaultFont: TGuiFont=( FontName:''; FontHeight:12; Style:[];FontColor:(blue:255;green:255;red:255;alpha:255);
  9.                         OutLineColor:(blue:0;green:0;red:0;alpha:0); OutLineWidth: 1.0;
  10.                         ShadowColor:(blue:0;green:0;red:0;alpha:0); ShadowOffsetX:0;
  11.                         ShadowOffsetY:0; ShadowRadius:0);
  12. {$ENDIF}
  13.  

I managed to fix the compile-time error but only I use @IFNDEF.

But now I got a runtime-error because the program try to create the folder /etc/Lulutech. I believe it is a permission issue, 'common' users are not allowed to modify things inside /etc.
Title: Re: Game Contest 2018
Post by: Lulu on May 17, 2018, 05:21:08 pm
Hello Handoko :) Thanks for your interest and your patience !
For me, (on windows) the IFNDEF directive don't work...
So, I replaced the const declaration by a function the return the default font. I think it will remove all problems
Code: Pascal  [Select][+][-]
  1. function DefaultFont: TGuiFont;
  2. ...
  3. function DefaultFont: TGuiFont;
  4. begin
  5.  Result.FontName:='';
  6.  Result.FontHeight:=12;
  7.  Result.Style:=[];
  8.  Result.FontColor:=BGRAWhite;
  9.  Result.OutLineColor:=BGRABlack;
  10.  Result.OutLineWidth:= 1.0;
  11.  Result.ShadowColor:=BGRABlack;
  12.  Result.ShadowOffsetX:=0;
  13.  Result.ShadowOffsetY:=0;
  14.  Result.ShadowRadius:=0;
  15. end;
  16.  

For the problems file access, I use GetAppConfigDirUTF8 to retrieve a folder where to save a config file for the game (player list, last player...). I have just re-read the documentation of this function and I have not taken into account the note 'On Linux, normal users are not allowed to write to the /etc directory. Only users with administration rights can do this.'
So, in the game source, in the unit 'AppIniFile.pas', at line 81 I changed the previous code
Code: Pascal  [Select][+][-]
  1. Result := IncludeTrailingPathDelimiter( GetAppConfigDirUTF8(TRUE, TRUE) );
  by
Code: Pascal  [Select][+][-]
  1. {$IFDEF WINDOWS}
  2.   Result := IncludeTrailingPathDelimiter( GetAppConfigDirUTF8(TRUE, TRUE) );
  3. {$ELSE}
  4.   Result := IncludeTrailingPathDelimiter( GetAppConfigDirUTF8(FALSE, TRUE) );
  5. {$ENDIF}
  6.  
The first parameter of the GetAppConfigDirUTF8 function is set to FALSE in the Linux version -> this return the local user folder and not the global. I hope this will remove the run time error.
source code updated: www.lulutech.fr/Logitheque/FireWire/FireWireGameSrc.7z (http://www.lulutech.fr/Logitheque/FireWire/FireWireGameSrc.7z)
Title: Re: Game Contest 2018
Post by: Handoko on May 17, 2018, 06:17:45 pm
Thank you for the update.

But now the program exits immediately after starting. After I enable the debug info, I got a runtime error 232. And this is what the documentation says:

Quote
232 Threads not supported
Thread management relies on a separate driver on some operating systems (notably, Unixes). The unit with this driver needs to be specified on the uses clause of the program, preferably as the first unit (cthreads on unix).

I don't know much about it, maybe some seniors can help.
Title: Re: Game Contest 2018
Post by: Lulu on May 17, 2018, 08:08:55 pm
This time, I think the problems come that the project is in 'final' build mode, and in this mode, I forget to declare the -dDYNLINK and -dUseCThreads compile options... I only declare them in default mode... Sorry  :-[
I hope this time it will run.
Code updated in the previous link.
Title: Re: Game Contest 2018
Post by: Handoko on May 18, 2018, 02:34:21 pm
Hooray, it finally compiled and run without error.

But it still has an issue. I can't read the instruction. Tested on Lazarus 1.8.0 64-bit Gtk2 Ubuntu Mate 17.10 using GeForce GT 430 24-inch monitor.
Title: Re: Game Contest 2018
Post by: Lulu on May 18, 2018, 09:28:26 pm
Hooray, and... Ouch !... what a chain of problems ! it shows my level of programming ...
May be you have time again to do another try...

In the Main unit, -> object inspector, ->Form_Main, could you please change the WindowState property to wsNormal, and set the Width form to 1024 and height to 768 ?
Title: Re: Game Contest 2018
Post by: lainz on May 18, 2018, 11:47:55 pm
1024x768? My childhood memories are getting back to my mind.  :D
Title: Re: Game Contest 2018
Post by: Handoko on May 19, 2018, 07:50:14 am
Here it is, WindowState :=  wsNormal and size := 1024 x 768.
Title: Re: Game Contest 2018
Post by: circular on May 19, 2018, 10:35:26 am
Maybe there is problem with font size.
Title: Re: Game Contest 2018
Post by: Lulu on May 19, 2018, 10:54:27 pm
yes Circular, it is a font problem. I don't understand why the text is showned well on Windows and not on Linux.
In the game, the instructions are showned using the class TGuiTextArea. In TGuiTextArea.Create(...) an TBGRATextEffectFontRenderer associated with TBGRABitmap.TextRect() draw the text with the appropriate font on a TBGRABitmap, then convert it to opengl texture.
After few search, I found perhaps the issue:

In unit 'u_SpriteDefinition', line 543 there was:
Code: Pascal  [Select][+][-]
  1.  // child 1: TGuiTextArea to show the instructions in the appropriate language
  2.  FTextArea := TGuiTextArea.Create( StrRes[10,FCurrentCountry], 25, 25, Width-50, Height-50,
  3.                                    GuiFont('', 17, [], BGRA(200,200,200), BGRA(0,0,0), 3,
  4.                                    BGRA(0,0,0), 1, 1, 7), taCenter, tlCenter);
  5.  

In the Font definition, there is no name specified. I added 'Arial':
Code: Pascal  [Select][+][-]
  1.  // child 1: TGuiTextArea to show the instructions in the appropriate language
  2.  FTextArea := TGuiTextArea.Create( StrRes[10,FCurrentCountry], 25, 25, Width-50, Height-50,
  3.                                    GuiFont('Arial', 17, [], BGRA(200,200,200), BGRA(0,0,0), 3,
  4.                                    BGRA(0,0,0), 1, 1, 7), taCenter, tlCenter);
  5.  

Same with the country's panel, unit 'u_screen_title',  line 151.

I updated the code in the previous link.
I hope... :D
Title: Re: Game Contest 2018
Post by: circular on May 20, 2018, 12:46:40 am
It could be indeed if there is no font name. Also when the size is zero, it is somewhat undefined and some default size is used but that does not always work. Anyway I presume the 17 here is the font size so it is well defined.
Title: Re: Game Contest 2018
Post by: Lulu on May 20, 2018, 08:04:21 am
Yes, 17 is the font height used to draw the text.
For convenience, I have grouped all the font parameters used by TBGRATextEffectFontRenderer and TBGRABitmap.TextRect in a record called TGuiFont. The function GuiFont is used to fill the records fields.
Title: Re: Game Contest 2018
Post by: Ñuño_Martínez on May 21, 2018, 12:09:28 pm
Back on topic:

I want to participate, and I actually have two game ides for it, but I have to work in a game I did for a customer (professional, yay!  ;)) so no sources can be published (yet, may be in some years), so I can't participate (see rules (https://forum.lazarus.freepascal.org/index.php/topic,39495.msg271236.html#msg271236)).  May be I can after this game is finished, since the date is July 31.

Anyway I think I'll post updates here, can I?
Title: Re: Game Contest 2018
Post by: User137 on May 21, 2018, 12:22:26 pm
I have been without any game ideas for a long time, so i guess i can do something basic that already exists, like asteroids shooter. Every game's different in the end and they can be fun in their own way, and their controls.

I am using 3D art from https://opengameart.org/ , but will likely make effects with gimp. Here's a quick preview, which loads an OBJ file. I decided to not use any modelling application to adjust the model to game, instead i'm finetuning the model positioning, scale and texture attachings by code (nxPascal). So far ship seems to fit well in a 1-unit scale sphere, which is essential for tracking collisions.

edit: Just wanted to show how much better it looks after moving UV map 0.1 down... (Like, why isn't the model file accurate already that i have to modify coords relations?) Still not exactly like original. I'm not using emission map but that shouldn't make it that different. https://opengameart.org/content/hextraction-base-player-pod
edit2: Nevermind UV map was right, just texture is flipped vertically. Got it perfect.
Title: Re: Game Contest 2018
Post by: User137 on May 22, 2018, 01:04:36 am
Not sure if i spent more time making or playing it, but here's first release anyway  ::)  Hope it compiles and stuff:
https://1drv.ms/u/s!AkA8eob3K73BhAP1e-HadvLsLmZF
(Updated 23.5.2018)
I use 64-bit compiler, Win10 and Lazarus 1.8.4.

Also the controls are:
W,S,A,D and mouse: for movement
Left mouseclick for weapon
Spacebar for magnet special - it can build dangerous situations but if some asteroids are hiding at borders it can be useful tool. I saw it amusing how asteroids clump up with physics.
Mousewheel zoom is just extra.
Title: Re: Game Contest 2018
Post by: tr_escape on May 22, 2018, 10:00:45 am
Not sure if i spent more time making or playing it, but here's first release anyway  ::)  Hope it compiles and stuff:
https://1drv.ms/u/s!AkA8eob3K73BhAP1e-HadvLsLmZF
I use 64-bit compiler, Win10 and Lazarus 1.6.2 (i know it's propably outdated).

After few FileExistsUTF8() --> FileExists() editing it is worked. Also I'll check with my son for quality review :)

In windows it is working good.
Title: Re: Game Contest 2018
Post by: Lulu on May 22, 2018, 08:13:39 pm
I can not compile your game User137, I have this error at compile time (in French)

Compiler le paquet FCL 1.0.1 : Code de sortie 1 - Erreurs : 1
Error: Illegal parameter: -Twin64

May be because I have Lazarus 1.8.0 Win10 ?
Title: Re: Game Contest 2018
Post by: User137 on May 23, 2018, 01:26:01 am
Open Project Options menu, and go to "Config and Target". Choose Target OS (-T) and other options suitable for your config. Let know which changes you made if it works.
Title: Re: Game Contest 2018
Post by: josh on May 23, 2018, 01:59:32 am
Hi USer137,
I had to change a couple of things to get it to work,, very nice graphics :)

Using Lazarus Fixes. 1.8.5
Need to change a few things
Project Options, Target CPU to x86_64
Add into NxModel and NX Graph uses declaration, the unit LazFileUtils ( so the fileexistsutf8 works)
Title: Re: Game Contest 2018
Post by: User137 on May 23, 2018, 11:04:01 am
Ok, that's enough incompatibility... Updated Lazarus and replaced file in OneDrive.
- It complained about LazFileUtils in files that had "uses FileUtils", which no longer exists.
- I set Target OS to just (Default), so i hope it checks your installation and chooses automatically, at least for me that works.
- Worth mentioning, some textures are 2k resolution, and ship has roughly 5000 vertices. It's a performance test at the moment too so i didn't want to scale down. I never dip below the 60 fps. Also the physics don't have actual engine, i just remembered how i did collisions in demo and it seems to still work. It pushes objects away from eachother in tiny steps, sometimes multiple times per object per frame.

Anyway, more games?  :D
Title: Re: Game Contest 2018
Post by: Lulu on May 23, 2018, 08:40:45 pm
User137, now your game work ! Nice ! :)
Title: Re: Game Contest 2018
Post by: lainz on May 24, 2018, 03:54:05 am
Back on topic:

I want to participate, and I actually have two game ides for it, but I have to work in a game I did for a customer (professional, yay!  ;)) so no sources can be published (yet, may be in some years), so I can't participate (see rules (https://forum.lazarus.freepascal.org/index.php/topic,39495.msg271236.html#msg271236)).  May be I can after this game is finished, since the date is July 31.

Anyway I think I'll post updates here, can I?

Yes, share with us your game, is also the goal of this contest.

Ok, that's enough incompatibility... Updated Lazarus and replaced file in OneDrive.
- It complained about LazFileUtils in files that had "uses FileUtils", which no longer exists.
- I set Target OS to just (Default), so i hope it checks your installation and chooses automatically, at least for me that works.
- Worth mentioning, some textures are 2k resolution, and ship has roughly 5000 vertices. It's a performance test at the moment too so i didn't want to scale down. I never dip below the 60 fps. Also the physics don't have actual engine, i just remembered how i did collisions in demo and it seems to still work. It pushes objects away from eachother in tiny steps, sometimes multiple times per object per frame.

Anyway, more games?  :D

Good game =) Is too hard for me  :)
Title: Re: Game Contest 2018
Post by: Ñuño_Martínez on May 24, 2018, 12:08:23 pm
For those complaining about "Target" options (OS, CPU or widgetset) , you should use "Default" always, except if you need any specific optimizations for some reason, because you're doing cross-compiling stuff, or because you're doing any ASM stuff.

Anyway, if you don't use "Default" you must say it in your documentation always.

Didn't test it yet though. ::)
Title: Re: Game Contest 2018
Post by: fcu on May 24, 2018, 12:49:25 pm
@User137 nice graphics , but this prove that fcl-image is very slow :/
Title: Re: Game Contest 2018
Post by: Handoko on May 31, 2018, 06:10:22 am
yes Circular, it is a font problem.
...
I updated the code in the previous link.
I hope... :D

Sorry, for the late reply. I was very busy recently. Yes, now I can read the instruction. But I think I found a minor bug. The letter 'e' on the title Fire & Wire doesn't seem render correctly for me.
Title: Re: Game Contest 2018
Post by: Lulu on May 31, 2018, 08:20:21 am
And the red and blue component of the title and buttons colors are swapped. I'll see this problem later because I'm too busy at this time.
Thanks Handoko ! :)
Title: Re: Game Contest 2018
Post by: circular on May 31, 2018, 02:30:58 pm
Hello Lulu.

About the font problem, I don't know if I have the latest version but for me it crashes because Font.Name = ''. I solved it by adding a check in GuiFont() and putting 'Arial' in this case.

About the red-blue swap, here is it can be fixed it in oglcTexture.inc (note also the use of LineOrder):
Code: Delphi  [Select][+][-]
  1. function TTextureManager.InitFromBGRABitmap(aIma: TBGRABitmap ): PTexture;
  2. var dup:TBGRABitmap;
  3.  glFormat: GLenum;
  4. begin
  5.  dup := aIma.Duplicate as TBGRABitmap;
  6.  
  7.  if TBGRAPixel_RGBAOrder then
  8.    glFormat := GL_RGBA
  9.  else
  10.    glFormat := GL_BGRA;
  11.  
  12.  if dup.LineOrder = riloTopToBottom then
  13.    dup.VerticalFlip;
  14.  
  15.  Result := AddInstanceToList;
  16.  Result^.ImageWidth := dup.Width;
  17.  Result^.ImageHeight := dup.Height;
  18.  
  19.  Result^.TextureWidth := dup.Width;
  20.  Result^.TextureHeight := dup.Height;
  21.  
  22.  Result^.FrameWidth := dup.Width;
  23.  Result^.FrameHeight := dup.Height;
  24.  
  25.  Result^.FrameCount := 1;
  26.  
  27.  glGenTextures(1, @Result^.ID );
  28.  BindTexture( Result );
  29.  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, dup.Width , dup.Height, 0, glFormat, GL_UNSIGNED_BYTE, dup.Data );
  30.  
  31.  dup.Free;
  32.  
  33.  glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
  34.  glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
  35.  glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); // Linear Filtering
  36.  glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); // Linear Filtering
  37. end;

By the way, nice OGLC library  :)

About the font clipping of the title, I am not sure why but it seems the measured text size is not the same as the actual render size.
Title: Re: Game Contest 2018
Post by: lainz on May 31, 2018, 08:52:48 pm
About the deadline: please, for all participants, if your game is not finished, we can extend deadline a bit more, like I said to @Handoko in another thread.

We want to see these games!

I played good games here, ready to submit to itch.io, game jolt or indie db.
Title: Re: Game Contest 2018
Post by: Lulu on June 02, 2018, 05:42:48 pm
Quote
Hello Lulu.

About the font problem, I don't know if I have the latest version but for me it crashes because Font.Name = ''. I solved it by adding a check in GuiFont() and putting 'Arial' in this case.

About the red-blue swap, here is it can be fixed it in oglcTexture.inc (note also the use of LineOrder):
Code: Delphi  [Select]

    function TTextureManager.InitFromBGRABitmap(aIma: TBGRABitmap ): PTexture;
    var dup:TBGRABitmap;
     glFormat: GLenum;
    begin
     dup := aIma.Duplicate as TBGRABitmap;
     
     if TBGRAPixel_RGBAOrder then
       glFormat := GL_RGBA
     else
       glFormat := GL_BGRA;
     
     if dup.LineOrder = riloTopToBottom then
       dup.VerticalFlip;
     
...
Circular, it's a good idea ! fixed in the code.

Quote
By the way, nice OGLC library  :)
Thanks !
Title: Re: Game Contest 2018
Post by: lainz on June 18, 2018, 07:55:17 pm
A bit more than a month to end the contest.

What do you think about the next contest idea:

Create a simulation of a small universe, with creatures that can interact with the things you put in the universe, interact between them, beign capables of learning and making choices.

I know, sounds very tricky =)

Edit: I've added all projects to main page
https://forum.lazarus.freepascal.org/index.php/topic,39495.0.html

Start testing them, so you can vote when needed :)
Title: Re: Game Contest 2018
Post by: Paul_ on June 25, 2018, 06:44:18 pm
Pffff, l must finish my game in next 14 days before I will go away in summer :)

beign capables of learning and making choices

good idea but Black & White game is certainly beyond my capabilities ;D
Title: Re: Game Contest 2018
Post by: lainz on June 25, 2018, 11:10:06 pm
I've not played it but I remember that game..
 :)
Well. Maybe we can stay with the regular graphics contest next time and let the people do what they want, that worked before. More freedom and learning than that I can't imagine.  :D
Title: Re: Game Contest 2018
Post by: Paul_ on July 15, 2018, 10:02:40 pm
Here is my contribution to the contest :)

Pixel Warrior - https://github.com/SlavicGames
https://github.com/SlavicGames/PixelWarrior (Windows binary files included, click on "Clone or download"/"Download ZIP")

Platformer action game with destructible terrain, you can play 2 training missions in campaign. I have no more time now to finish enemy AI and next missions. It's really nice weather so I will make bicycle trip somewhere in Europe :) There are only static targets, when I get back, I'll finish it.

- source code is bit mess, there is no cleanup and I wrote it without any bigger concept. Also lot of stuff needs some polishing.
- controls are descripted in game
- you can use editor for making maps, it's not hard. Just load any mission and check how it's done. Editor controls are descripted in readme on GitHub.
- "graphics" is my work, sounds are somewhere from my HDD and internet

Folders PixelWarrior and PixelWarrior_Editor should be in one folder (+ SFML_units + SFML if someone will check code).

I found one bigger problem. On my PC, sometimes when I run it (with VSync), there is bad tearing. But when I close application and start again it's ok. Same for GAME_Template in csfml-fpc-engine folder. I did not test it on another PC yet.
Title: Re: Game Contest 2018
Post by: eny on July 15, 2018, 10:24:52 pm
Here is my contribution to the contest :)
Had a quick peek; seems some files are missing  ::)
Title: Re: Game Contest 2018
Post by: lainz on July 15, 2018, 10:38:20 pm
Good, I can't beat the first level as always..  :D
Title: Re: Game Contest 2018
Post by: Paul_ on July 15, 2018, 10:47:47 pm
Had a quick peek; seems some files are missing  ::)

Ups, I forgot add SFML folder, now it should be complete :) https://github.com/SlavicGames/SFML

Good, I can't beat the first level as always..  :D

Haha, movement is tricky :)
Title: Re: Game Contest 2018
Post by: lainz on July 28, 2018, 04:58:56 am
And the contest is ending. You have only 4 days to submit your game.

Then we can vote the winner.

Title: Re: Game Contest 2018
Post by: lainz on July 29, 2018, 01:16:19 am
This is my game for the contest, I made it just today (I know I said that I will be not participating, but I can't resist!)

https://github.com/lainz/Arkanoid

Made in just 2 hours.
Title: Re: Game Contest 2018
Post by: furious programming on July 31, 2018, 05:45:59 pm
Hello people!

I wanted to join the contest, but I will not be able to finish my project on time. And if a lot is done, there is still quite a lot to do. Therefore, so far I will not publish my project, but only describe what it was meant to be and what it is now, show some pictures and videos. I have been left with no more work for a month, so when I finish it, I will publish the project.


This project was initially meant to be just a simple, small windowed application, allowing to check a certain effect on retro 2D platform games. I'm talking about multi-layered levels where the hero can walk on every layer. Layers were to serve as a visual effect of depth (as a parallax scrolling), as well as a usable surface. This greatly expands the functionality of the levels, giving the opportunity to create not only large but also deep levels, in which movement is more difficult than in the one-layered (levels become a three-dimensional maze).

The parallax scrolling test and the visual effect of the transition between layers was finished long ago. Video presenting such functionality is available here: Deep Platformer – layers test (https://4programmers.net/Forum/Download/19440) (quality is not excellent—I had a problem with setting the recorder). But this effect could be used somewhere… So I decided to create a simple platformer using the above-described functionality (and written code of course).


Many times I saw newbies trying to create games without additional libraries (in a window environment), without hardware acceleration, so I decided that I would try to make the game only with the help of a standard form and basic bitmap class. The best it can be. I love retro games and consols, especially NES, so I decided to create this demo in a similar way as in the old days. No semi transparency, no floating point numbers to describe motion, game engine based on frame counting, not based on delta, etc. Going to be fun. I took TForm, TBitmap and wrote the whole code from scratch, each piece by myself. I did not design the code, I just opened the IDE and started writing.

I have determined that the game should contain:

- pixelated graphics (very low resolution),
- Limbo-style level design,
- simple animated intro, on the shape of NES games,
- simple menu, waiting for a key press and start the game,
- story consisting of short tutorial and several worlds,
- each world composed of title screen and several levels (each world in different background color),
- levels equipped with gateways to change the layer (to deeper or nearer),
- levels equipped with gateways to change the gravity direction (to up or down),
- hero as a small, animated square, able to walk and jump,
- moving fireflies to collect,
- animated outro and staff screen,
- fully functional debug mode, that allows to check the operation of each part of the game,
- easter eggs and a lot of references to old times,
- and more, more options.

The specifics of this project preclude calling it a full-fledged game, which is why I call it simply a technological demo. The lack of hardware acceleration is a big limitation, so this project will always be just a test. Therefore, the project code is not particularly universal or extensible.

Currently, the intro and main menu are ready, the logic associated with the hero and levels is also finished (hero control, fireflies movement, level and its content rendering, layer and gravity handling, collisions with the environment), as well as a fully functional debug mode, command line support and more. However, the story is not ready yet, neither the target worlds nor levels, nor the code responsible for traveling around them.


Currently, the project consists of 33 units, about 10.000 lines of code. The project also includes four console tools that allows to generate images of level layers, as well as binary files containing data about fonts, levels and title screens. There is still a bit of code to write, create binary files with title screens of the worlds and binaries with levels, fill some text files with information about this project.

Here is a recording containing a intro and menu: Deep Platformer – intro and main menu (https://4programmers.net/Forum/Download/19767) (menu level is not finished).

Few screenshots in the attachments.
Title: Re: Game Contest 2018
Post by: lainz on August 01, 2018, 03:13:33 am
Looking good, thanks for sharing your progress with us!

The time is over, now we need to vote the best game.

During August you can vote your favorite, but take this into consideration:
- You must download and compile the games, there will be no precompiled binaries, you can judge as well the easy of compiling in your favorite platform, and see the source code, because this is in fact a programming forum and not just the compiled game is what you "must" use to decide.
- There will be no poll this time despite what says the main thread. A simple comment explaining your choice is enough.
- You can vote only one game, but you can give feedback to the other games. If you mention more than one project, the vote that will count is of the first mentioned game or the one you indicate as the winner.
- Anyone can vote.
- Participants can only give feedback to the other games.

The list with the 7 projects is in the main thread, that has a link to the post where the game was published.

Feel free to discuss any inconvenience when compiling or glitches, bugs, anything.
Title: Re: Game Contest 2018
Post by: turrican on August 09, 2018, 08:59:36 am
Hello people!

I wanted to join the contest, but I will not be able to finish my project on time. And if a lot is done, there is still quite a lot to do. Therefore, so far I will not publish my project, but only describe what it was meant to be and what it is now, show some pictures and videos. I have been left with no more work for a month, so when I finish it, I will publish the project.


This project was initially meant to be just a simple, small windowed application, allowing to check a certain effect on retro 2D platform games. I'm talking about multi-layered levels where the hero can walk on every layer. Layers were to serve as a visual effect of depth (as a parallax scrolling), as well as a usable surface. This greatly expands the functionality of the levels, giving the opportunity to create not only large but also deep levels, after which movement is more difficult than after the one-layered (levels become a three-dimensional maze).

The parallax scrolling test and the visual effect of the transition between layers was finished long ago. Video presenting such functionality is available here: Deep Platformer – layers test (https://4programmers.net/Forum/Download/19440) (quality is not excellent—I had a problem with setting the recorder). But this effect could be used somewhere… So I decided to create a simple platformer using the above-described functionality (and written code of course).


Many times I saw newbies trying to create games without additional libraries (in a window environment), without hardware acceleration, so I decided that I would try to make the game only with the help of a standard form and basic bitmap class. The best it can be. I love retro games and consols, especially NES, so I decided to create this demo in a similar way as in the old days. No semi transparency, no floating point numbers to describe motion, game engine based on frame counting, not based on delta, etc. Going to be fun. I took TForm, TBitmap and wrote the whole code from scratch, each piece by myself. I did not design the code, I just opened the IDE and started writing.

I have determined that the game should contain:

- pixelated graphics (very low resolution),
- Limbo-style level design,
- simple animated intro, on the shape of NES games,
- simple menu, waiting for a key press and start the game,
- story consisting of short tutorial and several worlds,
- each world composed of title screen and several levels (each world in different background color),
- levels equipped with gateways to change the layer (to deeper or nearer),
- levels equipped with gateways to change the gravity direction (to up or down),
- hero as a small, animated square, able to walk and jump,
- moving fireflies to collect,
- animated outro and staff screen,
- fully functional debug mode, that allows to check the operation of each part of the game,
- easter eggs and a lot of references to old times,
- and more, more options.

The specifics of this project preclude calling it a full-fledged game, which is why I call it simply a technological demo. The lack of hardware acceleration is a big limitation, so this project will always be just a test. Therefore, the project code is not particularly universal or extensible.

Currently, the intro and main menu are ready, the logic associated with the hero and levels is also finished (hero control, fireflies movement, level and its content rendering, layer and gravity handling, collisions with the environment), as well as a fully functional debug mode, command line support and more. However, the story is not ready yet, neither the target worlds nor levels, nor the code responsible for traveling around them.


Currently, the project consists of 33 units, about 10.000 lines of code. The project also includes four console tools that allows to generate images of level layers, as well as binary files containing data about fonts, levels and title screens. There is still a bit of code to write, create binary files with title screens of the worlds and binaries with levels, fill some text files with information about this project.

Here is a recording containing a intro and menu: Deep Platformer – intro and main menu (https://4programmers.net/Forum/Download/19767) (menu level is not finished).

Few screenshots in the attachments.

Awesome work.
Title: Re: Game Contest 2018
Post by: furious programming on August 10, 2018, 03:24:50 am
@turrican: thanks.  8-)

I am slowly finishing work on this project, there really is not much left. I am currently finishing the fifth console tool—this time for generating binary files with animations (for intro, outro, staff screen and cutscenes). After generating files with animations, I will be able to finish the code responsible for handling the full story (worlds, levels and cutscenes). The rest of the code is ready. The final step will be to create target levels using the previously prepared tool.

Two more, maybe three weeks.
Title: Re: Game Contest 2018
Post by: lainz on August 11, 2018, 01:23:15 am
Please submit your game even if time has ended, you put a lot of interest on it.

In fact the purpouse of the contest is not about the winner, but sharing code, ideas and our works to the other Pascal programmers.

The feedback is more important than the winner, I think.

The game I liked more is Petris because I played Tetris in my childhood. Fire Wire is an amazing game, full of particle systems and drawing is the goal. Pixel Warrior is a tricky game, but I like the old school graphics. I played the other games, but I can't remember too much of them now, but I can remember there was another tricky game, and the rest was good as well.

I like my game also because I always wanted to do an Arkanoid clone, even if it's a very basic one.
Title: Re: Game Contest 2018
Post by: Ñuño_Martínez on August 13, 2018, 02:06:40 pm
I hHadn't had the time (mainly because bad planning it).  %)

I want to see your games. :)
Title: Re: Game Contest 2018
Post by: Chronos on August 15, 2018, 10:26:57 am
Please submit your game even if time has ended, you put a lot of interest on it.

In fact the purpouse of the contest is not about the winner, but sharing code, ideas and our works to the other Pascal programmers.

The feedback is more important than the winner, I think.

Then it would be better to accept any Lazarus/FPC game with source, even those developed for a long time and also those which are already finished. Because as you said, winner is not important. But which games brings better inspiration and implementation example? Small games created in few weeks/months just for purpose of contest or long term more mature games which can prove that Lazarus/FPC is capable of creation nice sophisticated games? People here have even some unfinished games so maybe game contest can be motivation for them to finish the game to release state. So it would be nice to accept any game with source. If the competition would be unequal then you can create multiple "prices" like in movie industry, "A winner for Best graphics is..." :)

And how many participated games had any audio support? Background music and sound effects? Or event multi-platform audio support? That should be simple to implement but unfortunately it isn't. I would like to see such game.

Anyway, better some game content than no contest :)
Title: Re: Game Contest 2018
Post by: Paul_ on August 15, 2018, 02:26:55 pm
Maybe you miss the meaning of these competitions and game jams. It's about creating something new from scratch in some period of time.
Most of them have really short limit like "make game during weekend".

If you have long term project.. what is the reason to put it into a competition?

Anyway in 6 months you can make almost anything.
Title: Re: Game Contest 2018
Post by: Chronos on August 16, 2018, 03:58:59 pm
Nope, I didn't miss anything. And 6 months is relative period of time. If you work daily and have other activities and family then 6 months can be pretty short. And what is better 1000 small random short games or 10 mature kind of A class games which can prove that this development tool is capable of creating big projects? Or is Pascal still just a toy language for teaching in schools? It was replaced by C++ several years ago at the university where I studied.

So basically this competition in current form is a waste of time from my point of view. Sure, there is a difference between work and fun. In my young age I also created useless programs just to learn something or to have a fun. After years my focus changed and I would like to see some nice complete games done in Delphi or Lazarus/FPC. Open source games where we can see working code and we could use it efficiently in our projects. One nice example is C-evo game which is pretty complex game which can be played for many hours. Yes, you can check source code how more complex games can be done even that the game is pretty old.

So it was just my reaction to lainz post where he admitted that contest itself is not as important as sharing code and ideas. Then why don't extend contest to be more broader to allow any game with Lazarus/FPC source? Why not allow same game to participate multiple years? Maybe more games would appear. But the community is too small so don't expect hundreds of games in contest :) And the contest doesn't need to be taken seriously.

Anyway I won't "organize" such competition so it was just my comment. I will continue to improve my games over many years in my free time.

I wish you more and better games for next year contest :)
Title: Re: Game Contest 2018
Post by: lainz on August 18, 2018, 09:50:01 pm
Hi, yes I'm seeing the "point" now.
Title: Re: Game Contest 2018
Post by: lainz on August 18, 2018, 09:58:02 pm
One nice example is C-evo game which is pretty complex game which can be played for many hours. Yes, you can check source code how more complex games can be done even that the game is pretty old.

I´ve seen a screenshot and it talks by itself.  :)
Title: Re: Game Contest 2018
Post by: circular on August 18, 2018, 10:02:05 pm
I suppose if someone bring one project to the context one year, and next year, adds significant things to it, it could be presented again.

[sweet irony on]
A part from that, if you don't have time, well, that's what is called life. You know some people choose to have a life? Why do that? And have friends and the like. No no, be solitary and be a geek,
[sweet irony off]
Title: Re: Game Contest 2018
Post by: lainz on August 18, 2018, 10:12:47 pm
 :'( It makes me feel alive right now.
Title: Re: Game Contest 2018
Post by: circular on August 18, 2018, 10:22:25 pm
I know that's tough
Title: Re: Game Contest 2018
Post by: Handoko on October 18, 2018, 09:05:54 pm
Any news about Game Contest 2018?

I missed this contest but I hope I can participate in the next contest. What would be the topic of Game Contest 2019? Text-mode (unit crt) games, educational games, Android games? Tell me please, so I can be well prepared earlier.
Title: Re: Game Contest 2018
Post by: lainz on October 24, 2018, 03:15:19 pm
Any news about Game Contest 2018?

I missed this contest but I hope I can participate in the next contest. What would be the topic of Game Contest 2019? Text-mode (unit crt) games, educational games, Android games? Tell me please, so I can be well prepared earlier.

Hi, I learned the lesson if you read previous posts... things like this needs more time. Maybe we can do another one for next year but with more time.
Title: Re: Game Contest 2018
Post by: Handoko on October 24, 2018, 04:19:12 pm
I hope Game Contest can be better managed in the future. It is a good opportunity for newbies even experienced programmers to gain more skills in game programming. I really learned a lot from my participation, which can't be found from books nor the Internet.
Title: Re: Game Contest 2018
Post by: lainz on October 24, 2018, 04:39:35 pm
Well that's the truth we only learn with practice.

We can do it all the next year from January to December so there is more chance to make something.

As circular said we can bring our old games improved.

I need a bit of help writing the guidelines of the contest.

I don't want to limit to Android games even if it's the trend.
Title: Re: Game Contest 2018
Post by: Paul_ on October 25, 2018, 09:21:23 am
I'm not sure about the longer term.

Maybe it might be better to have small and clear goals like:
- world/map generator
- cellular automata/Game of life
- Arkanoid game
.. (can be poll)

Which do not take much time, let's say max. 2-3 months.
With a clear announcement of the competition, end and vote on winners.

Benefits:
- simple/strict rules works
- cca 4-5 competitions per year - "Wow, it lives here" :)
- if you are busy right now, no problem, you have opportunity join next time
- we can compare code because all participants have same task
Title: Re: Game Contest 2018
Post by: Ñuño_Martínez on October 27, 2018, 11:38:22 am
If you want a jam, I'll [try to] join Itch.io's Game Off 2018 (https://itch.io/jam/game-off-2018).  It starts November 1st. and will last for a month.
Title: Re: Game Contest 2018
Post by: Lulu on October 29, 2018, 01:58:46 pm
Hello,
I think 2-3 months is too short to imagine and make a game, or it will only be a copy of an existing one...
Gain more skills in game programming and create an original game are both important for me.
Title: Re: Game Contest 2018
Post by: Ñuño_Martínez on October 30, 2018, 12:29:22 pm
Hello,
I think 2-3 months is too short to imagine and make a game, or it will only be a copy of an existing one...
Gain more skills in game programming and create an original game are both important for me.
Then I'll not ask about 48/72 hours contests. ;D

We at Pascal Game Development (https://www.pascalgamedevelopment.com/) did a few 1-3 month contests and people did pretty nice games.  You must think about these jams as prototype jams, the goal is not to make a complete game but a prototype or a concept.  If you like the result then finish the game after it.
Title: Re: Game Contest 2018
Post by: lainz on November 11, 2018, 11:29:50 pm
I like the idea of 2-3 months, so I started this new platformer contest, and it's fair because there is already made stuff to start making the game with no problems:

2D Platformer Game Contest 2018/2019
https://forum.lazarus.freepascal.org/index.php/topic,43177.0.html

I as well added small and clear goals as suggested.
Title: Re: Game Contest 2018
Post by: minesadorada on November 12, 2018, 07:48:15 am
Who needs fancy graphics for a game?
I bring you....

Argument Bingo!

http://www.charcodelvalle.com/bingo/argumentbingo.zip (http://www.charcodelvalle.com/bingo/argumentbingo.zip)
Title: Re: Game Contest 2018
Post by: lainz on November 12, 2018, 05:23:51 pm
Thanks for submitting a game!

However I can't test it on Mac because lazautoupdate doesn't install with OPM it gives an error, and OPM did not display what the error is.
TinyPortal © 2005-2018