Opened 15 years ago

Last modified 9 years ago

#304 new enhancement

Refactor engine (remove game-specific functionality)

Reported by: Jan Wassenberg Owned by:
Priority: Nice to Have Milestone: Backlog
Component: Core engine Keywords:
Cc: Patch:

Description

Goals:

  • describe ideas on how to improve code organisation
  • long-term, this would allow people to build a new game (different EXE) on the basis of the pyrogenesis engine. however, that gives us little to no short/mid-term benefit; hence we're not concentrating on getting that to actually work now.
  • the shorter-term benefit is that code-base becomes easier to understand (especially for new members).

the engine is split up into static libraries and atlas/collada are in separate DLLs (we haven't had bad experiences with "DLL hell").

Game.h is surprisingly clean and doesn't contain 0ad-specific stuff.

Gamesetup

  • should be moved into a 0ad-game folder or similar
  • non-game-setup logic like Render() should be moved to a separate file. Most of this is shared with atlas and could be called "common" or similar (both need to initialize, and sharing is better than copy/paste).
  • contains atlas specific-stuff (slated to be removed in #303)
  • Paths.cpp contains 0ad specific code, that should be read through configuration.

Change History (5)

comment:1 by Jan Wassenberg, 15 years ago

Milestone: Open Source ReleaseAlpha

comment:2 by (none), 13 years ago

Milestone: Alpha

Milestone Alpha deleted

comment:3 by Andrew, 13 years ago

Milestone: Backlog

comment:4 by fabio, 11 years ago

Eventually it could be nice if the same pyrogenesis installation could be used for 0 A.D., its mods and total conversions. Using different EXEs may lead to other forking the engine and make incompatible changes that may be useful to others but difficult to merge between them. Debian recently did some work to make the ioquake3 installation compatible with different games, see:

A simple first step could be to rename the tarballs, what's currently called 0ad could be renamed to pyrogenesis, and 0ad-data to 0ad. Having them in different source repository could also help.

comment:5 by Stan, 9 years ago

What's up with this ticket ?

Note: See TracTickets for help on using tickets.