Skip to content

Commit

Permalink
WORKING!
Browse files Browse the repository at this point in the history
  • Loading branch information
GeneralGuy4872 committed Jul 15, 2020
1 parent a433c1f commit acefc31
Show file tree
Hide file tree
Showing 166 changed files with 3,449 additions and 256 deletions.
22 changes: 22 additions & 0 deletions Licensing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
LICENSING
=========

The project, as a complete entity, is licensed under the terms of the GNU
General Public License, Version 2.0, or at your option, any later version.

I reserve the right to republish some libraries which I consider to be
modularly independant of the project, but which are being published for the
first time as part of the project, at a later date under a less restrictive
liscense.

*(note: I originally intended to liscense the project under the GPLv3, and
some parts of the source code archive have comments to this effect; I have
since chosen to commit to the GPLv2 or later because of various
potential complications regarding liscense propagation and the linux
kernel.)*

*this is not legal advice, and I am not a lawyer. I am a programmer with
signifigant disdain for legal trolls suppressing the advancement of
knowladge, and I personally believe this liscense to be the best way of
preventing this.*

144 changes: 96 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,81 @@ IWannaFly (working title)

***Pre-Pre-Alpha version...idek***

A Nearly Realtime RPG Engine written in C, C++, and Angelscript
---------------------------------------------------------------
***(And possibly Objective-C and Objective-C++)***
A Nearly Realtime RPG Engine written in C, C++, and lua
-------------------------------------------------------

At this point, I've learned a bunch of stuff on both the programming and
metaprogramming\* level, and I think I have a pretty good idea of how to
move forward. This project was started primarily as a self-study
opportunity, and it's been a fun journey.

I have now settled on a language, an overall structure, some libraries,
and a ui/gameplay style. from here, I do not forsee any further false
starts and hope to have smooth(ish) sailing through to a working alpha!

I have now settled on a language, an overall structure, and some
libraries. from here, I do not forsee any further false starts and hope
to have smooth(ish) sailing through to a working alpha!

The game engine uses the
[Irrlicht Engine](http://irrlicht.sourceforge.net/) for rendering 3d
graphics, [Cairo Graphics](https://www.cairographics.org/) for rendering
pictures, [NCurses](https://invisible-island.net/ncurses/) for
rendering dialog and menus, and
[AngelScript](https://www.angelcode.com/angelscript/) for general pourpose
scripting and debugging. to save space, the engine uses the half-precision
floating point implementation at http://half.sourceforge.net/

~~despite using C++, the majority of the project should be in C...~~ The
design goal of having a C API has been scrapped, in favor of using the
[AngelScript](https://www.angelcode.com/angelscript/) language. the
advantage to this is that Angelscript is JIT compiled (thus eliminating
pointer persistance problems) and has the crucial ability to directy access
and alter C data, which many of the scripting languages I considered
lacked.
pictures, [NCurses](https://invisible-island.net/ncurses/) for rendering
in-game dialog, and [lua](http://www.lua.org/) for both extensions and a
command line\
*additional dependancies will follow...*

use of an [external debugger](https://www.gnu.org/software/gdb/) is
recommended if **Bad Things** start happening.

C code will use notation in variable names to seperate namespaces, using
`$$` in place of `::` *(this requires that a compiler support the extension
detailed in ISO 9899 Annex J.5.2)*
`$$` in place of `::` *(this requires that a compiler support the
extension detailed in ISO 9899 Annex J.5.2)*

2 example games will be provided: a high fantasy game with a wide cast of
playable characters, and a cyberpunk game with a single customizable
character. when reporting bugs, please note if the bug concerns the engine,
or one of the games, and which part of the engine or game.
character. chunks can be connected in such a way to form wormholes that
are one-way or bidirectional.

when reporting bugs, please note if the bug concerns the engine, or one
of the games, and which part of the engine or game; additionally, if the
bug concerns a freshly loaded state, try *turning it off and on again*.

CODING STYLE
============

occasionally, a type of C coding called "Object Style C" will be used,
which takes the following form:
`namespace$$pseudo_class$$method(pseudo_object,arg,arg,arg...)`

functions that in fortran would be called "subroutines" are also used,
and will be denoted by returning an implicit int or the SYSINT macro
(which evaluates to the empty string *(implicit int)* in C and to `int`
in C++)

the types in `<stdint.h>` (or <cstdint>) should be used when an integer
of a specific width is required, with the exception that `char` should be
prefferred to `int8_t`, and `unsigned char` should be prefferred to
`uint8_t`. if an interger bitfield uses less than the full number of
bytes in an int, then it should be signed; otherwise it should
(*usually*) be unsigned.

`struct`s should be catagorized into bitpacked structs and loosly-packed
structs. every field of a bitpacked struct should have an explicit width,
and should be of type `signed`, `unsigned`, or `bool`. a loosly-packed
struct should never use explicit-width fields. bitpacked structs should
eventually be replaced with interger bitfields.

since `this` is a reserved word in C++, and `self` is a reserved word in
Objective-C, when using Object Style C, the object variable will be named
`adhoc`; the variable will be named `here` for lowlevel functions using an
opaque pointer to operate on contiguous memory.
Objective-C, when using Object-Style-C, the object variable will be named
`opaque` for `void *` pointers to C++ objects, or `object` for pointers
whose type is known; the variable will be named `here` for lowlevel
functions using an opaque pointer to operate on contiguous memory.
similarly, since `new` is a keyword in C++ with a compleatly different
meaning, an object that is being constructed by a function will be named
`nova`. `input` may be employed as the primary, or only, argument of a
function. `output` will be the return value. `acc` is an **acc**umulator,
and should be a register variable.

variables with generic names follow the following conventions:
- `x`, `y`, `z`, and `w` refer to coordinates
- `x`, `y`, `z`, and `w` refer to coordinates. `w` isn't used often.
- `i` and `j` are `for`-loop iterators, either in the sense of C++
`::iterator`s or in the sense of intergal counters
- `n` and `m` are generic numbers, usually for-loop intergal counters
Expand All @@ -65,41 +89,65 @@ variables with generic names follow the following conventions:

a naming system similar to
[Systems Hungarian](https://en.wikipedia.org/wiki/Hungarian_notation)
is revived for the pourpose of manually mangling C functions that can take
multiple argument types, as this allows such functions to maintain C
is revived for the pourpose of manually mangling C functions that can
take multiple argument types, as this allows such functions to maintain C
linkage while also having faux overloads. this is similar to functions in
the C standard library such as `abs()` and `fabs()`.

FILENAMES
=========
files should use the following extensions:
- C preprocessor files
- `*.def` : C preprocessor macros
- C files
- `*.c` : C code
- `*.h` : C header
- `*.inl` : inline functions
- C++ files
- `*.cc` : C++ code
- `*.hh` : C++ header
- `*.tmpl` : C++ template
- C or C++ files
- `*.H` : C or C++ header
- `*.inc` : transclusion, for editing conveniance
- data files
- `*.txt` : raw text
- `*.ro4` : ciphertext (see below)
- `*.curses` : bytecode for a curses interpreter
- `*.lua` : a lua script

files ending in .ro4 contain severe spoilers, and have been ciphered by
applying a [Circular Shift](https://en.wikipedia.org/wiki/Circular_shift)
of 4 to every byte of the file (the result is the same in either direction
like in a rot13 cipher); the program I use is provided in `nybbleswap.c`,
which is designed to be used in a shell pipeline.\
to cipher a file:\
of 4 to every byte of the file (the result is the same in either
direction like in a rot13 cipher); the program I use is provided in
`nybbleswap.c`, which is designed to be used in a shell pipeline.\
to cipher a file:
`cat plaintext.txt | nybbleswap > ciptertext.ro4`\
to uncipher a file:\
to uncipher a file:
`cat ciphertext.ro4 | nybbleswap > plaintext.txt`\
to view a file:\
to view a file:
`cat ciphertext.ro4 | nybbleswap`\
to edit a file:\
to edit a file:
`cat ciphertext.ro4 | nybbleswap | vim -`

The code will be liscensed under the terms of the GPL, version 2.0 or, at
your option, any later version; unless the usage kernel calls makes it
impossible on systems using the linux kernel (it *really* shouldn't). some
general pourpose code libraries which are modularly independant of the game
engine may be offered under more permissive liscenses, or under a public
domain release, when not used as part of the whole; these parts will have
their liscense noted seperately. at present, liscensing information may be
absent due to the early stage and bumpy progress of the program's
development; this will be remedied no later than when the program is in a
state such that it can be compiled, however the non-working prealpha code
can be provided with an appropriate liscense upon request.
---

*at various points in development, I have entertained using the following
libraries, but have since decided to go with a different design:
- Guile
- Perl
- Raylib
- GLX
- Angelscript
- s7 scheme
- Chaiscript
earlier branches of the source tree may include broken code that uses
these libraries.*

---

\**note: as I've been learning, one of the things I've been teaching myself
has also been the git system; as a result, instead of branching the repo
at two specific "flag day" points of development, I -forked- it instead.
at two specific "flag day" points of development, I *forked* it instead.
Mistakes were made. If you want to see these relics (you really don't),
I will leave them as-is.*
17 changes: 0 additions & 17 deletions conventions.md

This file was deleted.

17 changes: 8 additions & 9 deletions cursesdataformat.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
serialization format:
NCurses scene serialization format
==================================

size of field... value field contains
====================================
header:
sizeof(ptrdiff_t)... number of blocks in file
**header:**
uint16_t...number of blocks in file

block:
sizeof(ptrdiff_t)... number of chars in the block
sizeof(int)... attribute mask
char[]... data of string
**blocks:**
uint16_t...number of chars in the block
uint16_t...attribute mask
char[]...string
15 changes: 15 additions & 0 deletions cyberpunk/OpeningScene.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
The second half of the 21st century brought the world the Singularity, and with it many new technologies, amoung them cybernetic augmentation and general pourpose artificial intelligence; and, for a time, it was not bad.

but soon, discontentedness began to emerge. not the ever-present discontentedness of the oppressed, but instead a primal greed amoungst those who, upon having eliminated that which sated their quest for more, now sought a new outlet for their evils.

they find it by taking that which does not belong to them, in all manner of ways. tangible property is stolen. ideas are litigated. people are enslaved.

many would say what happened next was unavoidable...

this is not the second half of the 21st century.
this is the early 23rd century.
the world lies in ruin.

you awaken with no memories of who you are, in a neutral zone between a warring corprate federation and fascist empire. a message has been written on your arm:

- gjragl guerr ryrira abegu cevzebfr cnff (13)
11 changes: 11 additions & 0 deletions cyberpunk/Opening__Background.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
player should awaken in an alley, with no money,
no weapons aside from a shiny copper pipe

upon trying to leave the allyway, they suprise a mugger.
the player kills the mugger with a single attack.
they drop a throwing knife, and 2 wanted posters (WANTED1.txt and
WANTED2.txt).

before reading these, it should be noted that the prices in the game are
typically given in kilo-currency or kilo-credits, and are always divisible
by 10 or 25.
16 changes: 16 additions & 0 deletions cyberpunk/WANTED1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
W A N T E D

[picture]

%s

7,500,000,000
goverment currency

ENEMY OF THE STATE

blah blah blah blah blah blah
bounty hunters are warned not
to listen to the criminal's
vile sedition and lies blah
blah blah blah blah blah blah
17 changes: 17 additions & 0 deletions cyberpunk/WANTED2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
W A N T E D

[picture]

%s

10,000,000,000
MegaCorp® credits

IP Theft, tresspassing,
terms-of-life violation

blah blah blah blah blah blah
bounty hunters are warned not
to listen to the criminal's
vile slander and lies blah
blah blah blah blah blah blah
9 changes: 0 additions & 9 deletions cyberpunk/open

This file was deleted.

Empty file removed databasesystem.txt
Empty file.
65 changes: 50 additions & 15 deletions dependancies.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,50 @@
C
C++
M4
Irrlicht
OpenGL-mesa
NCurses
NCursesw
Curses Forms
Curses Menu
X11
Cairo on X
libuuid
libmd
jsdev
doxygen
Dependancies
- C standard libraries
- C++ standard libraries
- system libraries
- Irrlicht
- OpenGL-mesa
- NCurses
- NCursesw
- Curses Forms
- Curses Menu
- Cairo on X
- ?libmd?
- jsdev
- s7 extension language
- ?X Athena Widgets?

To build
- C/C++ compiler toolchain
- gcc reccommended
- ?M4?
- make
- shell redirection
- shell pipes

To run
- X11 session
- X Virtual Terminal (x2)
- XTerm, Unicode, 256-color recommended
- the program must be invoked with the dev file path of the terminal it
is **not** invoked on as one of its arguments.
- invocation arguments are parsed into a scheme alist
- ((argv[odd] . argv[even]) ...)

To play
- Keyboard with Numeric keypad
- Mouse
- Gamepad with at least
- 2x analogue stick
- 2x throttle or trigger
- hat or d-pad
- 11 buttons

To debug
- external debugger program
- gdb reccommended
- X Virtual Terminal (+1)

other
- doxygen
- makeinfo
Loading

0 comments on commit acefc31

Please sign in to comment.