Retro3D


NameRetro3D JSON
Version 2.7 PyPI version JSON
download
home_page
Summary3D Game Engine with software rendering written in Python
upload_time2023-03-30 20:51:38
maintainer
docs_urlNone
authorDeepak Deo
requires_python
licenseMIT
keywords 3d game engine software rendering python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![Logo](https://github.com/deepakbr14/Retro3D/blob/master/doc/Logo.png?raw=True)
# Welcome to Retro3D!
Retro3D is a 3D game engine written in Python. All of the rendering is done in code (as opposed to using your 3d video card).
<BR><BR>
To use this library, you will need to have Python installed on your machine. The project was built using Python 3.10.10
<BR><BR>
You will also need to have pip installed. I did it on Windows like this:
* curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
* python3 get-pip.py
* rm get-pip.py
<BR><BR>
### Two ways to use Retro3D
1) Install the library using  
   ```pip install Retro3d```  
2) Clone/Download the project from  
   https://github.com/deepakbr14/Retro3D  
   and add it to your project/solution.

   Make sure to install its requirements:
   * terminal to the Retro3D directory that has the file **`requirements.txt`**
   * ```pip install -r requirements.txt```
<BR><BR>
### Sample Project : HelloRetro3D
https://github.com/deepakbr14/HelloRetro3D  
This is the simplest form of a project using Retro3d.  
It just shows a rotating cube. 
![Hello World](https://github.com/deepakbr14/Retro3D/blob/master/doc/HelloWorldScreenShot.png?raw=True)
<BR><BR>
### Sample Project : Combat
https://github.com/deepakbr14/Combat  
This is basic clone of the arcade game BattleZone. This game will show you how to handle camera rotation, model loading, sound, music, player input, and 2D HUD graphics. Retro3D uses pygame for functionality like drawing, sound, etc.
![Combat](https://github.com/deepakbr14/Retro3D/blob/master/doc/CombatScreenShot.png?raw=True)
https://youtu.be/kFMuBot71Jg
<BR><BR>
### How to step through Retro3D Engine Code
I've built Retro3D using Microsoft Visual Studio Community 2019.  
My Visual Studio Solution looked like this:
- Solution  
    - Combat
    - Retro3d
      
I added the Retro3d.pyproj (python project) as a reference.
<BR><BR>
### Easy Game Development
The 'game engine' part of Retro3D is there so you can get your  
game up and running quickly.

The game title, instructions, and credits are all auto-generated  
based on the contents of your ConfigGame object.

For example, when you do this

```
config = ConfigGame()

config.screen_resolution = pg.math.Vector2(1024, 768)
config.title = "Combat";
config.author = "Deepak Deo"
config.year = "1977"
```

the game engine automatically creates a window (1024x768) and shows the title and author on the cover screen.
![Cover](https://github.com/deepakbr14/Retro3D/blob/master/doc/GameCoverScreenShot.png?raw=True)
<BR><BR>
You can also easily add instructions...
![Instructions](https://github.com/deepakbr14/Retro3D/blob/master/doc/GameInstructionsScreenShot.png?raw=True)
<BR><BR>
and game credits.
![Credits](https://github.com/deepakbr14/Retro3D/blob/master/doc/GameCreditsScreenShot.png?raw=True)
<BR><BR>
### Future Changes
##### 3D Engine
* engine optimizations
* better inline documentation of 3d engine math 
* autoreflections - just the geometry upside down
* some form of very cheap shadows
* Have not yet passed the teapot test..
* Display lists should hold tris, not objs
  for better optimization + variety of rendering types within
  a single object (i.e. solid + transparent, etc)
* Need proper clipping. should be adding vertices to show part of the poly.
  use z buffer to hide 'behind' polys
  engine still needs to handle object draw ordering
* Use .mtl file along with .obj so that the obj files can have color per face info
  also, need to use 'materials' so that we can color objs on top of what the .obj file specifies.
  right now it's just one color per object
* Support multiple lights, multiple light types (i.e. point), and light color
* Optimize by use njit properly
  https://numba.readthedocs.io/en/stable/user/performance-tips.html
* Optimize draw_normals method
* Optimize Matrix class: should have pre-multipled matrix methods: ie zxyt
* The core pipeline is shit:
  not using python for single line list processing as i should
  copying and recopying vert_lists/matrices when dealing with vertex transformation
  normals transformation is even worse!
  math could use some streamlining
* Draw vertices with flag (like normals)
  self.draw_vertices = False
  if obj.draw_vertices:
      for vertex in list_vertex:
          pg.draw.circle(self.screen, pg.Color('white'), vertex, 6)    
* Shaded outline shouldn't show the diagonal line of the tri
  maybe precalc which line is the longest and flag it
<BR>
##### Game Engine
* Upgrade rez system. Maybe break out sound into a proper
  sound engine. 
* Create a high score system that auto stores on line.
  Develoepr should just have to say type of score.
* support for full screen mode. see  
  https://www.delftstack.com/howto/python-pygame/set-window-to-fullscreen-in-pygame/
* need safety code for model loading. assuming just tris right now.
* formal font system. just drop in a folder and use. 
  art and sound should be just as easy.
* Formal input system.
  Support mouse input for Game
* Use texture sheets
<BR>
##### Common
* Make code more 'pythonic'
* Need simpler/cleaner way of doing imports 
* Abstract out pygame stuff or use directly?
  i.e. font system, image loading with error checking
  same for python standard lib and si code.
* 'dsd's in code
<BR>
##### Community
* Instructions on how others can contribute to the project.
* how do others tell me/us what new features they want or  
  what bugs they find?
* Formal page on retro3D.org or something like that.  
  Have documentation of Engine functions and tutorials.
  And some youTube vids! And some place to converse about
  using this thing. Don't forget to udpate url in setup.py  
  and links in this readme file.
* Make some more sample games:
  - Fighter Jet
  - Racing
  - Space Battle
  - Tron
  - Fractal Terrain Flyer
<BR>
##### Cosmetic Changes
* Want a cheesy 80s/90s style 3d game engine intro.  
  see https://youtu.be/DIMlll1gOWQ?t=31
* Make the Cover/Instructions/Credits look less-shitty :/
<BR><BR><BR><BR>



# Change Log

<BR>

### 1.0 (Jan 11, 2023)
- First Release
<BR><BR>

### 1.1 (Jan 11, 2023)
- Reorg
<BR><BR>

### 1.2 (Jan 12, 2023)
- Another reorg
<BR><BR>

### 1.3 (Jan 12, 2023)
- Added game config
<BR><BR>

### 1.4 (Jan 12, 2023)
- Added BackgroundInfo to support from flat to mutli-part-gradient backgrounds
<BR><BR>

### 1.5 (Jan 12, 2023)
- Support for hud drawing
- Added a shaded outline draw list
<BR><BR>

### 1.6 (Jan 17, 2023)
- Added safety check to Engine.__calc_face_color by making sure dot product parameter is in valid range
<BR><BR>

### 1.7 (Jan 18, 2023)
- Fixed issue of vertices that were behind the camera were being drawn
- Fixed normals - which was causing a dot product miscalc
<BR><BR>

### 2.7 (Mar 31, 2023) 
- Project reorg to work better with Pypi
- Built separate sample projects: HelloWorld and Combat.
- Added requirements.txt
- Setup rez system for fonts/images/sounds
- Dumped some Si functions in favor of pygame functions
- Added cover/instruction/credits system
- Fixed 3d math bugs
<BR><BR>

<BR><BR><BR><BR>



            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "Retro3D",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "3d game engine software rendering python",
    "author": "Deepak Deo",
    "author_email": "deepakbr14@yahoo.com",
    "download_url": "https://files.pythonhosted.org/packages/57/6a/ba1e5618ccdc16a7964c7e4a5d82b17bc90b9833960e9078119645513e4e/Retro3D-2.7.tar.gz",
    "platform": null,
    "description": "![Logo](https://github.com/deepakbr14/Retro3D/blob/master/doc/Logo.png?raw=True)\r\n# Welcome to Retro3D!\r\nRetro3D is a 3D game engine written in Python. All of the rendering is done in code (as opposed to using your 3d video card).\r\n<BR><BR>\r\nTo use this library, you will need to have Python installed on your machine. The project was built using Python 3.10.10\r\n<BR><BR>\r\nYou will also need to have pip installed. I did it on Windows like this:\r\n* curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py\r\n* python3 get-pip.py\r\n* rm get-pip.py\r\n<BR><BR>\r\n### Two ways to use Retro3D\r\n1) Install the library using  \r\n   ```pip install Retro3d```  \r\n2) Clone/Download the project from  \r\n   https://github.com/deepakbr14/Retro3D  \r\n   and add it to your project/solution.\r\n\r\n   Make sure to install its requirements:\r\n   * terminal to the Retro3D directory that has the file **`requirements.txt`**\r\n   * ```pip install -r requirements.txt```\r\n<BR><BR>\r\n### Sample Project : HelloRetro3D\r\nhttps://github.com/deepakbr14/HelloRetro3D  \r\nThis is the simplest form of a project using Retro3d.  \r\nIt just shows a rotating cube. \r\n![Hello World](https://github.com/deepakbr14/Retro3D/blob/master/doc/HelloWorldScreenShot.png?raw=True)\r\n<BR><BR>\r\n### Sample Project : Combat\r\nhttps://github.com/deepakbr14/Combat  \r\nThis is basic clone of the arcade game BattleZone. This game will show you how to handle camera rotation, model loading, sound, music, player input, and 2D HUD graphics. Retro3D uses pygame for functionality like drawing, sound, etc.\r\n![Combat](https://github.com/deepakbr14/Retro3D/blob/master/doc/CombatScreenShot.png?raw=True)\r\nhttps://youtu.be/kFMuBot71Jg\r\n<BR><BR>\r\n### How to step through Retro3D Engine Code\r\nI've built Retro3D using Microsoft Visual Studio Community 2019.  \r\nMy Visual Studio Solution looked like this:\r\n- Solution  \r\n    - Combat\r\n    - Retro3d\r\n      \r\nI added the Retro3d.pyproj (python project) as a reference.\r\n<BR><BR>\r\n### Easy Game Development\r\nThe 'game engine' part of Retro3D is there so you can get your  \r\ngame up and running quickly.\r\n\r\nThe game title, instructions, and credits are all auto-generated  \r\nbased on the contents of your ConfigGame object.\r\n\r\nFor example, when you do this\r\n\r\n```\r\nconfig = ConfigGame()\r\n\r\nconfig.screen_resolution = pg.math.Vector2(1024, 768)\r\nconfig.title = \"Combat\";\r\nconfig.author = \"Deepak Deo\"\r\nconfig.year = \"1977\"\r\n```\r\n\r\nthe game engine automatically creates a window (1024x768) and shows the title and author on the cover screen.\r\n![Cover](https://github.com/deepakbr14/Retro3D/blob/master/doc/GameCoverScreenShot.png?raw=True)\r\n<BR><BR>\r\nYou can also easily add instructions...\r\n![Instructions](https://github.com/deepakbr14/Retro3D/blob/master/doc/GameInstructionsScreenShot.png?raw=True)\r\n<BR><BR>\r\nand game credits.\r\n![Credits](https://github.com/deepakbr14/Retro3D/blob/master/doc/GameCreditsScreenShot.png?raw=True)\r\n<BR><BR>\r\n### Future Changes\r\n##### 3D Engine\r\n* engine optimizations\r\n* better inline documentation of 3d engine math \r\n* autoreflections - just the geometry upside down\r\n* some form of very cheap shadows\r\n* Have not yet passed the teapot test..\r\n* Display lists should hold tris, not objs\r\n  for better optimization + variety of rendering types within\r\n  a single object (i.e. solid + transparent, etc)\r\n* Need proper clipping. should be adding vertices to show part of the poly.\r\n  use z buffer to hide 'behind' polys\r\n  engine still needs to handle object draw ordering\r\n* Use .mtl file along with .obj so that the obj files can have color per face info\r\n  also, need to use 'materials' so that we can color objs on top of what the .obj file specifies.\r\n  right now it's just one color per object\r\n* Support multiple lights, multiple light types (i.e. point), and light color\r\n* Optimize by use njit properly\r\n  https://numba.readthedocs.io/en/stable/user/performance-tips.html\r\n* Optimize draw_normals method\r\n* Optimize Matrix class: should have pre-multipled matrix methods: ie zxyt\r\n* The core pipeline is shit:\r\n  not using python for single line list processing as i should\r\n  copying and recopying vert_lists/matrices when dealing with vertex transformation\r\n  normals transformation is even worse!\r\n  math could use some streamlining\r\n* Draw vertices with flag (like normals)\r\n  self.draw_vertices = False\r\n  if obj.draw_vertices:\r\n      for vertex in list_vertex:\r\n          pg.draw.circle(self.screen, pg.Color('white'), vertex, 6)    \r\n* Shaded outline shouldn't show the diagonal line of the tri\r\n  maybe precalc which line is the longest and flag it\r\n<BR>\r\n##### Game Engine\r\n* Upgrade rez system. Maybe break out sound into a proper\r\n  sound engine. \r\n* Create a high score system that auto stores on line.\r\n  Develoepr should just have to say type of score.\r\n* support for full screen mode. see  \r\n  https://www.delftstack.com/howto/python-pygame/set-window-to-fullscreen-in-pygame/\r\n* need safety code for model loading. assuming just tris right now.\r\n* formal font system. just drop in a folder and use. \r\n  art and sound should be just as easy.\r\n* Formal input system.\r\n  Support mouse input for Game\r\n* Use texture sheets\r\n<BR>\r\n##### Common\r\n* Make code more 'pythonic'\r\n* Need simpler/cleaner way of doing imports \r\n* Abstract out pygame stuff or use directly?\r\n  i.e. font system, image loading with error checking\r\n  same for python standard lib and si code.\r\n* 'dsd's in code\r\n<BR>\r\n##### Community\r\n* Instructions on how others can contribute to the project.\r\n* how do others tell me/us what new features they want or  \r\n  what bugs they find?\r\n* Formal page on retro3D.org or something like that.  \r\n  Have documentation of Engine functions and tutorials.\r\n  And some youTube vids! And some place to converse about\r\n  using this thing. Don't forget to udpate url in setup.py  \r\n  and links in this readme file.\r\n* Make some more sample games:\r\n  - Fighter Jet\r\n  - Racing\r\n  - Space Battle\r\n  - Tron\r\n  - Fractal Terrain Flyer\r\n<BR>\r\n##### Cosmetic Changes\r\n* Want a cheesy 80s/90s style 3d game engine intro.  \r\n  see https://youtu.be/DIMlll1gOWQ?t=31\r\n* Make the Cover/Instructions/Credits look less-shitty :/\r\n<BR><BR><BR><BR>\r\n\r\n\r\n\r\n# Change Log\r\n\r\n<BR>\r\n\r\n### 1.0 (Jan 11, 2023)\r\n- First Release\r\n<BR><BR>\r\n\r\n### 1.1 (Jan 11, 2023)\r\n- Reorg\r\n<BR><BR>\r\n\r\n### 1.2 (Jan 12, 2023)\r\n- Another reorg\r\n<BR><BR>\r\n\r\n### 1.3 (Jan 12, 2023)\r\n- Added game config\r\n<BR><BR>\r\n\r\n### 1.4 (Jan 12, 2023)\r\n- Added BackgroundInfo to support from flat to mutli-part-gradient backgrounds\r\n<BR><BR>\r\n\r\n### 1.5 (Jan 12, 2023)\r\n- Support for hud drawing\r\n- Added a shaded outline draw list\r\n<BR><BR>\r\n\r\n### 1.6 (Jan 17, 2023)\r\n- Added safety check to Engine.__calc_face_color by making sure dot product parameter is in valid range\r\n<BR><BR>\r\n\r\n### 1.7 (Jan 18, 2023)\r\n- Fixed issue of vertices that were behind the camera were being drawn\r\n- Fixed normals - which was causing a dot product miscalc\r\n<BR><BR>\r\n\r\n### 2.7 (Mar 31, 2023) \r\n- Project reorg to work better with Pypi\r\n- Built separate sample projects: HelloWorld and Combat.\r\n- Added requirements.txt\r\n- Setup rez system for fonts/images/sounds\r\n- Dumped some Si functions in favor of pygame functions\r\n- Added cover/instruction/credits system\r\n- Fixed 3d math bugs\r\n<BR><BR>\r\n\r\n<BR><BR><BR><BR>\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "3D Game Engine with software rendering written in Python",
    "version": "2.7",
    "split_keywords": [
        "3d",
        "game",
        "engine",
        "software",
        "rendering",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "576aba1e5618ccdc16a7964c7e4a5d82b17bc90b9833960e9078119645513e4e",
                "md5": "fd0604c00cebbb789a0cdb82c29e9d07",
                "sha256": "83248e3ddeb2eb148fa03be443812b1a644e36cb765067eceee84a3884011f7d"
            },
            "downloads": -1,
            "filename": "Retro3D-2.7.tar.gz",
            "has_sig": false,
            "md5_digest": "fd0604c00cebbb789a0cdb82c29e9d07",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 38609,
            "upload_time": "2023-03-30T20:51:38",
            "upload_time_iso_8601": "2023-03-30T20:51:38.510737Z",
            "url": "https://files.pythonhosted.org/packages/57/6a/ba1e5618ccdc16a7964c7e4a5d82b17bc90b9833960e9078119645513e4e/Retro3D-2.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-30 20:51:38",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "retro3d"
}
        
Elapsed time: 0.05033s