Skip to content

Commit

Permalink
v0.3.1: Fixes and small buildscript refactorings
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo Rehermann (Gustavo6046) committed Apr 27, 2019
1 parent 5546ffb commit 8d59fb5
Show file tree
Hide file tree
Showing 55 changed files with 2,204 additions and 2,201 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
out/*
/out
out/*
/out
2 changes: 1 addition & 1 deletion CREDITS.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
- freesound for misc sounds;
- freesound for misc sounds;
- Voices were made in TTS.
60 changes: 30 additions & 30 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
MIT License

Copyright (c) 2018 Gustavo Ramos Rehermann

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

----------

The ACC provided is NOT owned by or affiliated to Gustavo Rehermann in any way,
for it is just a Linux binary compiled and provided for ease of usage of this
software; nor does the ACS standard library files inside the STDACS folder. These
have therefore all their rights reserved by the ZDoom team, including the rights
of prohibiting by law every distribution of the Software that contains these files
(ACC and its standard library ACS files) if necessary.
MIT License
Copyright (c) 2018 Gustavo Ramos Rehermann
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
----------
The ACC provided is NOT owned by or affiliated to Gustavo Rehermann in any way,
for it is just a Linux binary compiled and provided for ease of usage of this
software; nor does the ACS standard library files inside the STDACS folder. These
have therefore all their rights reserved by the ZDoom team, including the rights
of prohibiting by law every distribution of the Software that contains these files
(ACC and its standard library ACS files) if necessary.
2 changes: 1 addition & 1 deletion LOADACS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ZETAACS
ZETAACS
12 changes: 6 additions & 6 deletions MAPINFO.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SpawnNums
{
83001 = ZTPathNode
83003 = ZTUseNode
83004 = ZTJumpNode
83005 = ZTAvoidNode
SpawnNums
{
83001 = ZTPathNode
83003 = ZTUseNode
83004 = ZTJumpNode
83005 = ZTAvoidNode
}
134 changes: 67 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
# ZetaBot
**The modern ZScript bot made for GZDoom**, made *by ZDoomers for ZDoomers*.

* Exactly **3748 lines** of code written **manually** (verified with `wc`)
* **Five** possible bot states (Wandering, Following, Attacking, Hunting and Fleeing)
* **Extensive debugging** (set by CVar `zb_debug`)
* Has the **attention of official ZDoom developers**
* Flexible **PK3 mod build script** solution (`build.sh`)
* Multiple male and female **voices**
* Pathnode system with **A\* pathfinding**
* Supports **any weapons and player classes** _(given there are modules for them, supplied by their respective modders)_
* Constraints akin to **real** players _(max speed, max firing rate, etc etc)_
* Weapon **rating** system

---

# How to Play

### Universal

The easiest way is to go to the Releases section of the repository and
downloading the PK3 attached to the latest release. Otherwise, you need
to run the build script in order to zip up the PK3 and get the launch script.

### Linux

1. Run your terminal window and `cd` to the folder with the ZetaBot source.
2. Run the buildscript:

./build.sh [-f <output folder : out>] [-s <path to source port : /usr/bin/gzdoom>] -i <path to the mod's IWAD>

It also supports optional CVar settings:

[-c <name=value> [-c <name2=value2> ...]]
And additional source port settings as well:

[-e <option>[=<value>] [-e <option>[=<value>] ...]]

For example:

./build.sh -f out -s gzdoom -i /usr/games/doom/doom2.wad -c zb_debug=1 -e "-nomonsters" -e "-skill=1" -e "+map=MAP18"

3. Launch:

cd <output folder : build>
./ZetaBot

For other mods that use the same buildscript, try `ls` to find a file,
of the same name as the mod's PK3, but without the version and extension
in the filename.

You only need to do the steps 1 and 2 once (unless you want to change the
CVARs set). You can also use the output PK3 as a normal mod, instead of
using the launchscript :)


### Windows

For Windows you can just zip up all the files directly in the top folder of the repo,
along with the following folders:

* ZetaCode
* sprites
* sounds
* acs
* source
# ZetaBot
**The modern ZScript bot made for GZDoom**, made *by ZDoomers for ZDoomers*.

* Exactly **3748 lines** of code written **manually** (verified with `wc`)
* **Five** possible bot states (Wandering, Following, Attacking, Hunting and Fleeing)
* **Extensive debugging** (set by CVar `zb_debug`)
* Has the **attention of official ZDoom developers**
* Flexible **PK3 mod build script** solution (`build.sh`)
* Multiple male and female **voices**
* Pathnode system with **A\* pathfinding**
* Supports **any weapons and player classes** _(given there are modules for them, supplied by their respective modders)_
* Constraints akin to **real** players _(max speed, max firing rate, etc etc)_
* Weapon **rating** system

---

# How to Play

### Universal

The easiest way is to go to the Releases section of the repository and
downloading the PK3 attached to the latest release. Otherwise, you need
to run the build script in order to zip up the PK3 and get the launch script.

### Linux

1. Run your terminal window and `cd` to the folder with the ZetaBot source.
2. Run the buildscript:

./build.sh [-f <output folder : out>] [-s <path to source port : /usr/bin/gzdoom>] -i <path to the mod's IWAD>

It also supports optional CVar settings:

[-c <name=value> [-c <name2=value2> ...]]
And additional source port settings as well:

[-e <option>[=<value>] [-e <option>[=<value>] ...]]

For example:

./build.sh -f out -s gzdoom -i /usr/games/doom/doom2.wad -c zb_debug=1 -e "-nomonsters" -e "-skill=1" -e "+map=MAP18"

3. Launch:

cd <output folder : build>
./ZetaBot

For other mods that use the same buildscript, try `ls` to find a file,
of the same name as the mod's PK3, but without the version and extension
in the filename.

You only need to do the steps 1 and 2 once (unless you want to change the
CVARs set). You can also use the output PK3 as a normal mod, instead of
using the launchscript :)


### Windows

For Windows you can just zip up all the files directly in the top folder of the repo,
along with the following folders:

* ZetaCode
* sprites
* sounds
* acs
* source
142 changes: 71 additions & 71 deletions ZetaCode/Obstacles.zsc
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
class ObstacleCheckWaiter : Thinker
{
enum WaitState
{
CS_NOTHING,
CS_PENDING,
CS_WALL,
CS_ACTOR
};

WaitState st;
}

class ObstacleChecker : Actor
{
Default
{
Speed 1;
Projectile;
}

ObstacleCheckWaiter waiter;

void SetState(uint st)
{
if ( waiter != null )
waiter.st = st;
}

static ObstacleCheckWaiter MakeFor(Actor other, double ang, double maxDist)
{
ObstacleCheckWaiter waiter = new("ObstacleCheckWaiter");
waiter.st = ObstacleCheckWaiter.CS_PENDING;

ObstacleChecker ck = ObstacleChecker(other.SpawnMissileAngleZ(24, "ObstacleChecker", ang, 0));

if ( ck == null )
return null;

ck.speed = maxDist;
ck.waiter = waiter;

return waiter;
}

States
{
Spawn:
TNT1 A 1;
TNT1 A 0
{
SetState(ObstacleCheckWaiter.CS_NOTHING);
}
Stop;

Crash:
XDeath:
TNT1 A 0
{
SetState(ObstacleCheckWaiter.CS_ACTOR);
}
Stop;

Death:
TNT1 A 0
{
SetState(ObstacleCheckWaiter.CS_WALL);
}
Stop;
}
}
class ObstacleCheckWaiter : Thinker
{
enum WaitState
{
CS_NOTHING,
CS_PENDING,
CS_WALL,
CS_ACTOR
};
WaitState st;
}
class ObstacleChecker : Actor
{
Default
{
Speed 1;
Projectile;
}
ObstacleCheckWaiter waiter;
void SetState(uint st)
{
if ( waiter != null )
waiter.st = st;
}
static ObstacleCheckWaiter MakeFor(Actor other, double ang, double maxDist)
{
ObstacleCheckWaiter waiter = new("ObstacleCheckWaiter");
waiter.st = ObstacleCheckWaiter.CS_PENDING;
ObstacleChecker ck = ObstacleChecker(other.SpawnMissileAngleZ(24, "ObstacleChecker", ang, 0));
if ( ck == null )
return null;
ck.speed = maxDist;
ck.waiter = waiter;
return waiter;
}
States
{
Spawn:
TNT1 A 1;
TNT1 A 0
{
SetState(ObstacleCheckWaiter.CS_NOTHING);
}
Stop;
Crash:
XDeath:
TNT1 A 0
{
SetState(ObstacleCheckWaiter.CS_ACTOR);
}
Stop;
Death:
TNT1 A 0
{
SetState(ObstacleCheckWaiter.CS_WALL);
}
Stop;
}
}
Loading

0 comments on commit 8d59fb5

Please sign in to comment.