Skip to content

Commit

Permalink
finally push commit
Browse files Browse the repository at this point in the history
  • Loading branch information
GeneralGuy4872 committed Jun 9, 2020
1 parent 25a2821 commit a433c1f
Show file tree
Hide file tree
Showing 109 changed files with 2,974 additions and 680 deletions.
36 changes: 24 additions & 12 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,23 +1,35 @@
core.autocrlf=false

**/* = linguist-vendored=false linguist-documentation=false linguist-detectable=false diff
/manual/**/* = linguist-detectable=true
/manual/plaintext/**/* = linguist-documentation=true
*.c = linguist-language=C
*.h = linguist-language=C
*.m = linguist-language=objc
*.mm = linguist-language=objc++
*.cc = linguist-language=C++
*.hh = linguist-language=C++
*.hm = linguist-language=objc
*.hmm = linguist-language=objc++
*.def = linguist-language=C
*.inc = linguist-language=C
*.inl = linguist-language=C
*.struct = linguist-language=C
*.tmpl = linguist-language=C++
*.cclass = linguist-language=C++
*.c.m4 = lingust-language=m4 linguist-language=C
*.h.m4 = lingust-language=m4 linguist-language=C
*.cc.m4 = lingust-language=m4 linguist-language=C++
*.hh.m4 = lingust-language=m4 linguist-language=C++
*.def.m4 = lingust-language=m4 linguist-language=C
*.inc.m4 = lingust-language=m4 linguist-language=C
*.struct.m4 = lingust-language=m4 linguist-language=C
*.tmpl.m4 = lingust-language=m4 linguist-language=C++
*.cclass.m4 = lingust-language=m4 linguist-language=C++
*.as = linguist-language=AngelScript
*.m4 = linguist-language=m4
*.c.m4 = linguist-language=m4 linguist-language=C
*.h.m4 = linguist-language=m4 linguist-language=C
*.m.m4 = linguist-language=m4 linguist-language=objc
*.mm.m4 = linguist-language=m4 linguist-language=objc++
*.cc.m4 = linguist-language=m4 linguist-language=C++
*.hh.m4 = linguist-language=m4 linguist-language=C++
*.hm.m4 = linguist-language=m4 linguist-language=objc
*.hmm.m4 = linguist-language=m4 linguist-language=objc++
*.def.m4 = linguist-language=m4 linguist-language=C
*.inc.m4 = linguist-language=m4 linguist-language=C
*.inl.m4 = linguist-language=m4 linguist-language=C
*.struct.m4 = linguist-language=m4 linguist-language=C
*.tmpl.m4 = linguist-language=m4 linguist-language=C++
*.cclass.m4 = linguist-language=m4 linguist-language=C++
*.as.m4 = linguist-language=m4 linguist-language=AngelScript
*.awk = linguist-language=awk
*.PL = linguist-language=perl
99 changes: 89 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,105 @@
IWannaFly (working title)
=========================

***<Pre-α 0.9.0.0***
***Pre-Pre-Alpha version...idek***

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

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
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!

despite using C++, I have decided that to maximise the utility of the
engine, I want the public API to be in plain C. namespaces will be
seperated by <CODE>___</CODE>
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/

*note: as I've been learning, one of the things I've been teaching myself
~~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.

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)*

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.

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.
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
- `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
- `tmp` is a temporary variable, usually holding an intermidiate value.
- `T` is a type in a template
- `L` is a length (ℓ); it breaks from the usual capitalization rules
because of the `1`/`l`/`I` rule
- `data` is the main data member of an object

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
linkage while also having faux overloads. this is similar to functions in
the C standard library such as `abs()` and `fabs()`.

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:\
`cat plaintext.txt | nybbleswap > ciptertext.ro4`\
to uncipher a file:\
`cat ciphertext.ro4 | nybbleswap > plaintext.txt`\
to view a file:\
`cat ciphertext.ro4 | nybbleswap`\
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.

---

\**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.
I will leave them as-is.*
18 changes: 18 additions & 0 deletions concepts.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
the event loop is implemented in Object styled C with some small C++
subsystems. it is based on the dlfcn library. the loop is arranged as
a circular singly linked list, with each element capible of building
a stack of queued frames; after a frame is done executing, any queued
frames are shunted to be executed after it until the stack is empty;
this data layout resembles a wooden crown gear. the function pointer
is of type «int(f*)(unsigned argc,void *argv[])», and is called via
dlsym or, if specifyed to be avalible, dlfunc.

this could be changed to an angelscript engine, where
dlfunc(«module»,«symbol») is replaced by
engine->GetModule(«module»)->GetFunctionByDecl(«symbol»).

the commandline is implemented with angelscript. actions use underlying
C++ objects that define the capibilities of each race/species; each
command calls a method on the object for that species/class. the method
in question may do something expected, something unexpected, produce an
error message, or produce a silly message.
6 changes: 6 additions & 0 deletions conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ critical errors will `exit(`...`)`, `abort()`, or `raise(`...`)` a signal.

bogon checking, to mitigate database corruption, will use assertions.
example: `assert(localfoo == *originalfoo)`

The plan for the navigational database is to write a simple shell program
in Objective-C++, using templates and it's introspection capabilities to
wrap void pointers that will build a stack that holds the path of the $PWD.
syntax will be based on the API; however, the ability to do anything other
than `PEEK` and `POKE`, and even that, is very much deferred.
27 changes: 27 additions & 0 deletions cyberpunk/fragments
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
save your game guy - man, my life sucks!
I'm just a nobody from nowhere!
heck, if life was an RPG, I wouldn't even be
the protagonist; I'd be the guy standing in
the starting area that says "Don't forget to
save your game!"

---

homeless man - hey, maaan!
here, take a tinfoil hat!
why? HAHAHAhahaha...
*grab*
...thEy'rE reAdin oUr thOUghtS...


(note: he's not as crazy as he seems...)

---

your shadow - who am I?
I'm everything that you are not.
I'm everything that you've forgot.
I'm everything that you should be--
don't you wish... that you were me⸮

---
9 changes: 9 additions & 0 deletions cyberpunk/open
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
player should awaken in an alley, with no money,
no weapons aside from a shiny copper pipe,
and no guidence other than a note saying
"they are after you-- trust no-one".

upon trying to leave the allyway, they suprise a mugger.
the player kills the mugger with a single attack, who drops
a throwing knife and a picture of the player with the player's
name and "5,000,000,000 credits" written on it
10 changes: 10 additions & 0 deletions doctypes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.man.* a Linux manpage
*.mdoc.* a NetBSD manpage

*.m(an|doc).3iwf a manpage on the C api
*.m(an|doc).5iwf a manpage on file formats
*.m(an|doc).6iwf a game package's manpage
*.m(an|doc).6 the engine's manpage

*.texinfo plugin technical documentation,
lore reference materials for players and devs
2 changes: 1 addition & 1 deletion questdialogs/ElfPaladin.txt → fantasy/ElfPaladin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ delagate from <mountains further east, border> - there have been certain
supplies, including ampel food, but no soldiers. we will attempt a
rendezous at the southern border.
mayor - (ampel food?...)
delagate from <north; you are standing with them> -
delagate from <north> (you are standing with them) -
I can provide 4 soldiers: 3 archers and a paladin.
valiant soldiers from our small village.
entering siren - then you seem to be in need of a caster.
Expand Down
1 change: 1 addition & 0 deletions fantasy/ascension.ro4
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
�C����W�gVv'�w�7G'��v���'G��&WG��W'G��V�7W⠐����'G���77G�'�Wv�G��7�6V⠠�����⠠�C����W.�.�.۠�����Gr7G�V��ƗG���v��W��G'V�ƗfV'��7�rG�G�7��W6��wV'����7��v�Vw�'F��"��"⠠�C���G��F��W�f�VgV'��FV�V7����Wv���w�W�F�Ҡ������Ww�W�Fw�G�&�'V�Vw�G��F�VG�'VG7��r���W'w�'7GfV'v�gV栐f�'�����'G�G�G6�7G�FWG���W��F��w�7�'VG�V��7� �W��V77��V�fG�V��v�6�W�6��w�G7G�6��VF�w��V'VG�V�7V�gV7 �&'V���vF��V�G'VG�V7��G�V'�6V77�F7G'G��vw'�f���WGW�Ɨ77W'VFFV7G'W6G�����r�G���vG�V�W�FV'֗'�GV6G��� ��F����W6�F�&�WG�G�7v��wV'G�V�FVG�⠠�C���v��wV'7���������҆���w�G�G��Wv�G⠐�w��7V'7��6��Vw�G��V�G�V'Vr77���6��6VG�GG�V�6GW�Ɨ��֖v�GF�G�G���W7VV�����'G�&V��v7�fv'VG�wV'GV�FG�&V��ƖGG�V���G�W6�����w�V�7����V��7W�G7G�V�'Vv�⒠
File renamed without changes.
8 changes: 8 additions & 0 deletions fantasy/dissonance.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[1] - I've never understood
why your people let their own endure so
much suffering. beyond this city, the
outlying fifes have great surplus of
land and food, yet here people starve.
is this invented concept of "money" so
important to them that they will let
people, children, die for it?
File renamed without changes.
1 change: 1 addition & 0 deletions fantasy/farlook/spoilercharacter1.ro4
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
�Gr7G�Vw�����G�V6���w���6��V7&���W'��FV�WGVgV'�fVw�F�7G�v�gV��Wf��F�F6���⠖77�V���V�V77G��󠠠G�Vw���w7wV'��vG�V6���G����FV�V'7�'V�w��v7w��w77�V��V���v��W�7�'V�7�GV�W��7��⠠��GGW'�7�WG7�Vr7G�VV�FV'r7�FWv�GV'���W6�rG'���W�6V�V'��V�7�VG�����WG��V'g���vVw�V�G�V6�G�vW'F6�VG�'�F��W'���FV�WG⠠�7�Vr7F���v���G�V'V�W7G&V�7��VG���v��W6�F����
46 changes: 28 additions & 18 deletions questdialogs/fragments.txt → fantasy/fragments.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
� = refer to spoiler character table

***

gnome - I call it a computational engine. it uses thousands of small
mechanical parts to store and manipulate data! and as a recent
improvement, it is powered by... <B><I>Electricity!</>
Expand All @@ -9,20 +13,12 @@ gnome - I call it a computational engine. it uses thousands of small
has been suspended... I know that you suredly must be busy, but
could you perhaps fetch it for me?

***

sourcerer thug - oh, fiesty young street rat, eh? what are you going to do?
humans can't cast, so unless--
mentor - *snrkt*
thug - ...what are you laughing at, hag?
mentor - <I>oh, nothing. carry on.</>

***

*cold open*

(redshirt) - GO TO HELL YOU MONSTERS!!
��[evil] - <fg=red><B>Oh, I've been to hell. <I>I even <U>brought
[2] - <fg=red><B>Oh, I've been to hell. <I>I even <U>brought
some of it back with me</>

*chapter 2 titlecard*
Expand All @@ -46,23 +42,21 @@ siren magic instructor - it is easy for us to draw and hold magic; take

***

���[0] - Stop. that's not necissarry. you are no longer drawing energy from

�[0] - Stop. that's not necissarry. you are no longer drawing energy from
a well, or diverting it from a river. you are the precipace of a
waterfall, and if you cannot learn to stem the flow soon, you will
be eroded away by the current.

once I am sure you arn't a bigger threat than ���[evil], if only
from your inexperiance, you may leave.
be eroded away by the current passing through you. here, I can keep
you alive until you learn to control it.

***
�[0] - You're not the first to seek these monsters.

���[0] - You're not the first to seek these monsters.

you know wat they say about the one who fights them...
you know what they say about the one who fights them...

***

���[0] - REMEMBER...
??? (�[0]) - REMEMBER...

*note: all required characters start getting this event halfway through
chapter 2*
Expand Down Expand Up @@ -90,3 +84,19 @@ extra 2 - well, "<I>hyper-cosmic extradimensional currents induced by
exposing potential differentials in persistant background fields of
exotic quantum partical reservoirs</I>" is a bit verbose.
extra 1 - <I><U>but it's percise!</>

***

shady shopkeeper - ...offer void where prohibited, NULL when cast to a
pointer...
(programmer joke)

***

guard #1 - THERE! THAT ONE! THERE'S A 100,000,000 COIN BOUNTY ON THEM!
guard #2 - That sum could feed my family for a week!
guard #1 - screw your family, the money is mine!
*the first guard stabs the second guard*
guard commander - advance your career on your own time; AFTER THEM!

***
File renamed without changes.
20 changes: 20 additions & 0 deletions fantasy/languagelore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
NOTE: words that the character cannot understand will be randomized between
⍰ and �, and will blink.
NOTE: this is not yet implemented

the language of the sirens is vast and complex, combining vocalization of
the larnix and syrnix. few other species can understand it, and fewer still
can actually speak it.

it has two written forms: a complex dictation form, and a ‶simplified″
academic form. the dictation form is most commonly used, and records the
inflection of the words, as well as their dialectal pronunceation; there is
no standardized spelling. the academic form was invented to fix this, and
records generalized phonemes instead of exact sounds. the newer academic
form has gained universal acceptance in applications where the text is not
a proxy for a person's words, but presents it's own information; i.e. in a
novel, it has become standard practice to use the academic form for the
words of a dispassionate narrator, while continuing to use the dictation
form for dialouge spoken by characters. using the opposite form of writing
can be used artistically to invoke a response, although when done by
mistake it usually invokes mockery.
19 changes: 19 additions & 0 deletions fantasy/potential.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
thief, chapter 2, dream
=======================

[0] - You're asking yourself the wrong question.

In addition to psionics, humans can, in fact, cast basic spells;
several notable heros have done so. but doing so is _always_ fatal.
it is a matter of biology; the exotic energy causes too much damage
to a frail human body.

not only have you cast several high level spells of particularly
complex construction, but because of your lack of training, you
have done so in such a way that would bring an experianced elvan
battlecaster to their knees in agony...and you are none the worse
for wear.

why do you suppose that is?

*wakes up*
1 change: 1 addition & 0 deletions fantasy/spoilercharactertable.ro4
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
E�Tt%TE$�tE$�T�d5���T%4�%4ET%5�����������������������������������������Ӡ���GV���V'6�'6GV'7'V��G��6�WFVF������VW�FV6�FVF㣠��wV'fW�V�G�G��w��7wG�VF'v��7'�7V�Ff���G�V�'V��֖�Ɩ��7�f�V'7��F��F6��7�FV'G�V�7V�gV7G�V6'VG�V'�fG�V��'��V��V�G�V�wV'V��6V��'G���F'V�V�&V'&V��v��'GƳ��gvWV6�'6W�7G�6V7��w�GVgV'��v�V'��V�fV��7G�6VG�V�����&�G'VgV�GG�V�f'��F���v��'VG���667����ƗFg�6��v��G�V��G�w��6��7W7W�Ɨ66���VF&�7���v7W''VƠ�'�VG�'�6�WV7G���7&�WGG�V�GW'V�f'VƖG��FG�V7V�f�����VW�FV6�FVF㣠�G�VFWv�GV'�f7�'V�G'�&�V�FV'�w���7&VV�����W'�V�G���7VVG�V�W����F7��F�7vW�7V�#����VW�FV6�FVF㣠���ff�V�Fw���77�Wv�G�FGG��VFG�V�wV'G����%U�TE�T��u�%�D�Vw�7�V7G�V�f�'6V'W�V�f&7��WGV�'FV'�f�'G�V��"Fg�6V�V�G�f��6�g�Ɩ�G���"��F�7G�V&6���v�fG�V���6�V�GF'6��6�gV'��'F7�3����VW�FV6�FVF��FV�VvGVf'��G�VV�g�V7GV'�v''����V7���G�V�VFV'�f���GV'�G����7�'��vG�G�7G'���vG���FV7G&�Ɩ�VG�VV�g��ƖG�6�7�V'V�w�G�Ɩ�7G�G�V�W���F���'��7�V��'V7�G�V�'V'VgV�VFG�&V6G��v7G'��VvV�G��f�'�#��w��'��GƗ����7G�V�W����7''�g��C����VW�FV6�FVF㠐7V6�f�6v'��'VV'w��7VgV'VƗF�7Ɩ�V7�ճG�VGw��fG�V֠��gVgV'����v��7G�'��G�V�w�GG�VƖ֖�GV������V7G�G���Gw���6W''�fg�'w�G�G�V�'�7GV'7�S��
File renamed without changes.
Loading

0 comments on commit a433c1f

Please sign in to comment.