* * *

Author Topic: Big Metro - real-time metro building game  (Read 1553 times)

Chronos

  • Full Member
  • ***
  • Posts: 202
    • PascalClassLibrary
Big Metro - real-time metro building game
« on: November 24, 2017, 11:26:40 pm »
Project homepage: http://svn.zdechov.net/trac/BigMetro

This is first release of somehow unfinished but playable game clone of Mini Metro game  https://dinopoloclub.com/minimetro/. Original idea was just for fun to re-implement that game in Pascal. Its kind of fun to build metro lines and watch trains going back and forth transporting passengers :) In real world you don't want to rebuild tube every time when a new station appears somewhere. But here it costs nothing to move and reorganize all lines. So you can always optimize your metro system for better throughput.

Its also interesting to implement zoomable map with various moving elements as software rendering and achieve lower CPU load. There are not many nice complex fully featured games created in Lazarus/FPC yet. There is a long way for Lazarus to be simply usable for game development. Even simple native multi-platform Windows/Linux/Mac sound system for games is not there. But still we can try to push things forward.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 796
    • Burdjia
Re: Big Metro - real-time metro building game
« Reply #1 on: November 25, 2017, 11:51:50 am »
Cool indeed.  :)

Anyway I don't agree with you in this statement:
There are not many nice complex fully featured games created in Lazarus/FPC yet. There is a long way for Lazarus to be simply usable for game development. Even simple native multi-platform Windows/Linux/Mac sound system for games is not there. But still we can try to push things forward.
Actually there are a collection of libraries and engines for game development with FPC.  May be some are old but we (including myself) are working in new stuff as ZenGL, Allegro.pas, Luna Game Pascal, MinGRo and Castle Engine among others, as well as nice experiments like DelphiDoom, Thyandyr's Voxel Engine and Lua Game Library.  I would agree that there are not a lot of games lately though.

May be you should join Pascal Game Development not just to get information but also to help us change how the gamedev community sees Pascal.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4720
    • wiki
Re: Big Metro - real-time metro building game
« Reply #2 on: November 25, 2017, 12:07:42 pm »
Div by zero

in UGeometric.pas
function LineIntersect(LineAP1, LineAP2, LineBP1, LineBP2: TPoint): TPoint;

Line 113
  LDetDivInv := 1 / ((LDiffLA.X * LDiffLB.Y) - (LDiffLA.Y * LDiffLB.X));

LDiffLB = (0,0)

Code: Pascal  [Select]
  1. ~"#0  0x00440c41 in LINEINTERSECT (LINEAP1=..., LINEAP2=..., LINEBP1=..., LINEBP2=..., result=...) at UGeometric.pas:113\n"
  2. ~"#1  0x0043d0ee in TENGINE__SHIFTTRACKPOINTS (this=0x2f9c50) at UEngine.pas:1814\n"
  3. ~"#2  0x00438587 in TMETROLINE__CONNECTSTATION (STATION=0x24e398, LINESTATIONDOWN=0x313970, LINESTATIONUP=0x313eb0, this=0x23ef58) at UEngine.pas:888\n"
  4. ~"#3  0x0043e1c7 in TENGINE__MOUSEMOVE (POSITION=..., this=0x2f9c50) at UEngine.pas:2028\n"
  5. ~"#4  0x004361bd in TFORMMAIN__PAINTBOX1MOUSEMOVE (SENDER=0x26a930, SHIFT=..., X=485, Y=451, this=0x269a60) at ./Forms/UFormMain.pas:90\n"
  6. ~"#5  0x0052f23c in MOUSEMOVE (this=0x26a930, SHIFT=..., X=485, Y=451) at include/control.inc:4425\n"
  7. ~"#6  0x0052ef6d in WMMOUSEMOVE (this=0x26a930, MESSAGE=...) at include/control.inc:4384\n"
  8.  


LINEAP1={X = 498, Y = 538}
LINEAP2={X = 515, Y = 555}
LINEBP1={X = 515, Y = 555}
LINEBP2={X = 515, Y = 555}
RESULT=0x262f7b4
LDETLINEA=-680
LDETLINEB=0
LDETDIVINV=1.1945305291614955e+103
LDIFFLA={X = -17, Y = -17}
LDIFFLB={X = 0, Y = 0}
LINEINTERSECT=0x262f7b4
« Last Edit: November 25, 2017, 12:10:22 pm by Martin_fr »

Chronos

  • Full Member
  • ***
  • Posts: 202
    • PascalClassLibrary
Re: Big Metro - real-time metro building game
« Reply #3 on: February 03, 2018, 09:09:04 pm »
Version 1.0.1 (2018-02-03)
==========================

* Modified: High DPI support under Windows.
* Fixed: Zooming by mouse wheel was inverted. Not worked correctly with touch screen.
* Fixed: Avoid division by zero in line intersection calculation.

Download: https://svn.zdechov.net/trac/BigMetro

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus