1
0
Fork 0

(svn r2907) -Codechange: splitted the AIs to their own directory. AINew becomes 'trolly', AIOld becomes 'default', both in their own dir in the 'ai' dir. More AIs to come.

release/0.4.5
truelight 2005-09-02 19:10:45 +00:00
parent a181446829
commit d05f504c01
8 changed files with 90 additions and 89 deletions

View File

@ -573,11 +573,6 @@ endif
### Sources ### Sources
C_SOURCES += ai_old.c
C_SOURCES += ai_build.c
C_SOURCES += ai_new.c
C_SOURCES += ai_pathfinder.c
C_SOURCES += ai_shared.c
C_SOURCES += aircraft_cmd.c C_SOURCES += aircraft_cmd.c
C_SOURCES += aircraft_gui.c C_SOURCES += aircraft_gui.c
C_SOURCES += airport.c C_SOURCES += airport.c
@ -686,6 +681,12 @@ C_SOURCES += sound/null_s.c
C_SOURCES += video/dedicated_v.c C_SOURCES += video/dedicated_v.c
C_SOURCES += video/null_v.c C_SOURCES += video/null_v.c
C_SOURCES += ai/default/default.c
C_SOURCES += ai/trolly/trolly.c
C_SOURCES += ai/trolly/build.c
C_SOURCES += ai/trolly/pathfinder.c
C_SOURCES += ai/trolly/shared.c
CXX_SOURCES = CXX_SOURCES =
OBJC_SOURCES = OBJC_SOURCES =
@ -988,7 +989,7 @@ upgradeconf: $(MAKE_CONFIG)
### Internal build rules ### Internal build rules
# This makes sure the .deps dir is always around. # This makes sure the .deps dir is always around.
DEPS_MAGIC := $(shell mkdir -p .deps .deps/music .deps/sound .deps/video .deps/os .deps/os/macosx) DEPS_MAGIC := $(shell mkdir -p .deps .deps/music .deps/sound .deps/video .deps/os .deps/os/macosx .deps/ai/default .deps/ai/trolly)
# Introduce the dependencies # Introduce the dependencies
ifneq ($(MAKECMDGOALS), clean) ifneq ($(MAKECMDGOALS), clean)

View File

@ -1,22 +1,22 @@
/* $Id$ */ /* $Id: ai_old.c 2701 2005-07-24 14:12:37Z tron $ */
#include "stdafx.h" #include "../../stdafx.h"
#include "openttd.h" #include "../../openttd.h"
#include "functions.h" #include "../../functions.h"
#include "map.h" #include "../../map.h"
#include "tile.h" #include "../../tile.h"
#include "player.h" #include "../../player.h"
#include "vehicle.h" #include "../../vehicle.h"
#include "engine.h" #include "../../engine.h"
#include "command.h" #include "../../command.h"
#include "town.h" #include "../../town.h"
#include "industry.h" #include "../../industry.h"
#include "station.h" #include "../../station.h"
#include "pathfind.h" #include "../../pathfind.h"
#include "economy.h" #include "../../economy.h"
#include "airport.h" #include "../../airport.h"
#include "depot.h" #include "../../depot.h"
#include "variables.h" #include "../../variables.h"
// remove some day perhaps? // remove some day perhaps?
static Player *_cur_ai_player; static Player *_cur_ai_player;
@ -52,7 +52,7 @@ enum {
}; };
#include "table/ai_rail.h" #include "../../table/ai_rail.h"
static byte GetRailTrackStatus(TileIndex tile) { static byte GetRailTrackStatus(TileIndex tile) {
uint32 r = GetTileTrackStatus(tile, TRANSPORT_RAIL); uint32 r = GetTileTrackStatus(tile, TRANSPORT_RAIL);

View File

@ -1,16 +1,16 @@
/* $Id$ */ /* $Id$ */
#include "stdafx.h" #include "../../stdafx.h"
#include "openttd.h" #include "../../openttd.h"
#include "debug.h" #include "../../debug.h"
#include "functions.h" #include "../../functions.h"
#include "map.h" #include "../../map.h"
#include "tile.h" #include "../../tile.h"
#include "command.h" #include "../../command.h"
#include "ai_new.h" #include "trolly.h"
#include "engine.h" #include "../../engine.h"
#include "station.h" #include "../../station.h"
#include "variables.h" #include "../../variables.h"
// Build HQ // Build HQ
// Params: // Params:

View File

@ -1,15 +1,15 @@
/* $Id$ */ /* $Id$ */
#include "stdafx.h" #include "../../stdafx.h"
#include "openttd.h" #include "../../openttd.h"
#include "debug.h" #include "../../debug.h"
#include "functions.h" #include "../../functions.h"
#include "map.h" #include "../../map.h"
#include "tile.h" #include "../../tile.h"
#include "command.h" #include "../../command.h"
#include "ai_new.h" #include "trolly.h"
#include "depot.h" #include "../../depot.h"
#include "variables.h" #include "../../variables.h"
#define TEST_STATION_NO_DIR 0xFF #define TEST_STATION_NO_DIR 0xFF

View File

@ -1,11 +1,11 @@
/* $Id$ */ /* $Id$ */
#include "stdafx.h" #include "../../stdafx.h"
#include "openttd.h" #include "../../openttd.h"
#include "debug.h" #include "../../debug.h"
#include "map.h" #include "../../map.h"
#include "ai_new.h" #include "trolly.h"
#include "vehicle.h" #include "../../vehicle.h"
int AiNew_GetRailDirection(TileIndex tile_a, TileIndex tile_b, TileIndex tile_c) int AiNew_GetRailDirection(TileIndex tile_a, TileIndex tile_b, TileIndex tile_c)
{ {

View File

@ -1,37 +1,36 @@
/* $Id$ */ /* $Id: ai_new.c 2891 2005-08-26 20:26:34Z tron $ */
/* /*
* Next part is in Dutch, and only here for me, TrueLight, the maker of this new AI * This AI was created as a direct reaction to the big demand for some good AIs in OTTD.
* Too bad it never left alpha-stage, and it is considered dead in his current form.
* By the time of writing this, we, the creator of this AI and a good friend of mine,
* are designing a whole new AI-system that allows us to create AIs easier and without
* all the fuzz we encountered while I was working on this AI. By the time that system
* is finished, you can expect that this AI will dissapear, because it is pretty
* obselete and bad programmed.
*
* In the meanwhile I wish you all much fun with this AI; if you are interested as
* AI-developer in this AI, I advise you not stare too long to some code, some things in
* here really are... strange ;) But in either way: enjoy :)
*
* -- TrueLight :: 2005-09-01
*/ */
// TODO: als iemand een vehicle stil zet op een weg waar de AI wil bouwen #include "../../stdafx.h"
// doet de AI helemaal niets meer #include "../../openttd.h"
// TODO: depot rondjes rijden stom iets dingus #include "../../debug.h"
// TODO: jezelf afvragen of competitor_intelligence op niveau 2 wel meer geld moet opleverne... #include "../../functions.h"
// TODO: als er iets in path komt, bouwt AI gewoon verder :( #include "../../table/strings.h"
// TODO: mail routes #include "../../map.h"
#include "../../tile.h"
// FIXME: This code is horrible. Indisputably from the style POV, at least. --pasky #include "../../command.h"
#include "trolly.h"
/* #include "../../town.h"
* End of Dutch part #include "../../industry.h"
*/ #include "../../station.h"
#include "../../engine.h"
#include "stdafx.h" #include "../../gui.h"
#include "openttd.h" #include "../../depot.h"
#include "debug.h"
#include "functions.h"
#include "table/strings.h"
#include "map.h"
#include "tile.h"
#include "command.h"
#include "ai_new.h"
#include "town.h"
#include "industry.h"
#include "station.h"
#include "engine.h"
#include "gui.h"
#include "depot.h"
// This function is called after StartUp. It is the init of an AI // This function is called after StartUp. It is the init of an AI
static void AiNew_State_FirstTime(Player *p) static void AiNew_State_FirstTime(Player *p)

View File

@ -1,10 +1,10 @@
/* $Id$ */ /* $Id: ai_new.h 2892 2005-08-26 20:56:48Z tron $ */
#ifndef AI_NEW_H #ifndef AI_TROLLY_H
#define AI_NEW_H #define AI_TROLLY_H
#include "aystar.h" #include "../../aystar.h"
#include "player.h" #include "../../player.h"
/* /*
* These defines can be altered to change the behavoir of the AI * These defines can be altered to change the behavoir of the AI
@ -258,4 +258,4 @@ int AiNew_PickVehicle(Player *p);
int AiNew_Build_Vehicle(Player *p, TileIndex tile, byte flag); int AiNew_Build_Vehicle(Player *p, TileIndex tile, byte flag);
int AiNew_Build_Depot(Player *p, TileIndex tile, byte direction, byte flag); int AiNew_Build_Depot(Player *p, TileIndex tile, byte direction, byte flag);
#endif /* AI_NEW_H */ #endif /* AI_TROLLY_H */

View File

@ -20,7 +20,6 @@
#include "news.h" #include "news.h"
#include "saveload.h" #include "saveload.h"
#include "command.h" #include "command.h"
#include "ai_new.h"
#include "sound.h" #include "sound.h"
#include "network.h" #include "network.h"
#include "variables.h" #include "variables.h"
@ -566,6 +565,8 @@ void OnTick_Players(void)
} }
} }
extern void AiNewDoGameLoop(Player *p);
void RunOtherPlayersLoop(void) void RunOtherPlayersLoop(void)
{ {
Player *p; Player *p;