AI re-devlopment thread

Talk among developers, and propose and discuss general development planning/tackling/etc... feature in this forum.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: AI re-devlopment thread

Post by klauss »

All editors worth using have the option to generate only spaces, no tabs.

Notepad++ for windows has the option to generate only spaces, and IIRC, also the option to convert all tabs to spaces. In fact, all editors have the option to convert tabs into spaces: search and replace it's called.

All linux editors of note have also the same abilities.

I don't see where you get your idea that most do not.

About branches, I know, I just organize myself around tasks, so my branches are task-oriented and not author-oriented. I don't have a klauss branch, I have an ogre branch (shamelessly forgotten), an audio branch, and that's it ;), but there was a techniques branch.

I merge changes from trunk regularly (well, not often, but regularly) and when I'm done I merge back into trunk.

So, agreed, branch off for reformatting, and if there's any conflict the version in trunk has priority, just re-apply the sanitizer on that file. Makes a whole lot of sense.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: AI re-devlopment thread

Post by chuck_starchaser »

Okay, a branch it is, I guess; but I don't know how to make a branch, let alone how to merge one.
By the way, my setup's (both) are using spaces instead of tabs (4 per indent).
If people's editors don't have Use Spaces for Tabs, we can recommend them editors: Gedit in
Linux; Crimson in Windows.
I had one remaining small issue: sometimes when it removed braces from around single line
if body and there was an else if following, it inserted a blank line. I managed to cure that
problem by running a prepass with all config params at ignore, except for the removal of
braces from around single-statement bodies. Now it works perfectly.
I've cleaned my pc's fans, and booted it, and I'm doing now two weeks' worth of ubuntu updates;
then I'll get access to the server and show you formatting results.
charlieg
Elite Mercenary
Elite Mercenary
Posts: 1329
Joined: Thu Mar 27, 2003 11:51 pm
Location: Manchester, UK
Contact:

Re: AI re-devlopment thread

Post by charlieg »

To create a branch, the simplest way is to copy. Either create the branch (i.e. create a folder under branches/ with the name of the branch) and copy in relevant material or (not for VS but for lighter svn repos) just copy trunk/ to branches/foo/.
Free Gamer - free software games compendium and commentary!
FreeGameDev forum - open source game development community
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: AI re-devlopment thread

Post by klauss »

For VS too, the copy is fast in SVN, it's only a link within the database.

Then on your own working copy you do a switch, which only fetches the differences (usually nothing), and you're done.

In linux:

Code: Select all

$ svn copy <base url>/trunk <base url>/branches/<name of branch>
...
$ svn switch <base url>/branches/<name of branch>
...
It's a second.

That replicates the entire trunk, with data and everything, but it costs nothing to the server nor to you, since it only fetches differences.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Re: AI re-devlopment thread

Post by pheonixstorm »

Havent used crimson before, though I think Notepad++ is the best bet for windows. I spend a lot of time using its various plugins such as the hex and file compare plugs. There are a lot of plugins for it and you can write new ones if you find the need.

I'm gonna try out crimson though and see how that goes. If you want an editor thats not free check out multi-edit. If it hasn't gone to hell that is THE best editor for windows. Rough look at new features.. I think it might still be the best, but at a price.. $179 if you download it. For that amount I'll stick with the older copy or notepad++ :roll:
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: AI re-devlopment thread

Post by chuck_starchaser »

I forgot to test vegastrike before reformatting a few ai files, but in any case, for sure it's not crashing because of the ai files; something to do with audio... It crashes instantly; doesn't even open a window; --or at least not long enough for my retinas to register anything. Stderr.txt:

Code: Select all

GOT SUBDIR ARG = 
Found data in /home/d/vs/data/bin/..
Using /home/d/vs/data as data directory
USING HOMEDIR : /home/d/.vegastrike As the home directory 
CONFIGFILE - Found a config file in home directory, using : /home/d/.vegastrike/vegastrike.config
MISSION_NAME is empty using : main_menu.mission
Attempt to call ReadFull on a bad file units.csv
Only read 0 out of -1 bytes of units.csv
!!! ERROR/WARNING VSFile : on ReadFull : Unspecified error (maybe to document in VSFile ?)
running import sys
print sys.path
sys.path = [r"/home/d/vs/data/modules/builtin",r"/home/d/vs/data/modules/quests",r"/home/d/vs/data/modules/missions",r"/home/d/vs/data/modules/ai",r"/home/d/vs/data/modules",r"/home/d/vs/data/bases"]
testing VS randomrunning import sys
print sys.path
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
AL lib: alsa.c:388: Could not open playback device 'default': Permission denied
AL lib: oss.c:179: Could not open /dev/dsp: Device or resource busy
Expression 'SetApproximateSampleRate( pcm, hwParams, sr )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1294
Expression 'PaAlsaStreamComponent_InitialConfigure( &self->playback, outParams, self->primeBuffers, hwParamsPlayback, &realSr )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1873
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1994
AL lib: portaudio.c:127: Pa_OpenStream() returned an error: Invalid sample rate
Note that a few weeks ago I uninstalled pulseaudio, and installed alsa instead; which fixed my
audio problems then...

Anyways, here's some files you can gock at and give me feedback:
http://deeplayer.com/uncrustify/aggressive.h
http://deeplayer.com/uncrustify/aggressive.cpp
http://deeplayer.com/uncrustify/comm_ai.h
http://deeplayer.com/uncrustify/comm_ai.cpp
http://deeplayer.com/uncrustify/communication.h
http://deeplayer.com/uncrustify/communication.cpp
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: AI re-devlopment thread

Post by chuck_starchaser »

klauss wrote:In linux:

Code: Select all

$ svn copy <base url>/trunk <base url>/branches/<name of branch>
...
$ svn switch <base url>/branches/<name of branch>
...
...
That replicates the entire trunk, with data and everything, but it costs nothing to the server nor to you, since it only fetches differences.
The copy took a few seconds; but the switch is taking forever; seems to be going through all the files A this A that. Now it seems stuck at A /win32/bin/vorbisfile.dll.. --been there for like 15 minutes.
I'm going to bed; good night.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: AI re-devlopment thread

Post by chuck_starchaser »

Never mind, figured my problem: I was trying to svn switch the /vegastrike folder to the new branch.
I don't know why it skipped src; or why tools is unversioned...
Does this look like it worked?, or like it blew up?

Code: Select all

~/vs/vegastrike$ svn switch https://vegastrike.svn.sourceforge.net/svnroot/vegastrike/branches/reformat/vegastrike
D    vega-vc7
D    vega-vc8
D    mac
D    modtools
D    translations
D    history
D    masterserver
D    win32
A    README.MACOSX.rtf
A    ToDo.txt
A    icon2.ico
A    FindVorbis.cmake
A    icon3.ico
A    bootstrap-sh
A    AUTHORS
A    icon4.ico
A    FindGTK2.cmake
Skipped 'src'
A    buildmac.sh
A    Resources.aps
A    vegastrike.spec
A    CVSROOT
A    CVSROOT/cvswrappers
A    CVSROOT/checkoutlist
A    CVSROOT/editinfo
A    CVSROOT/rcsinfo
A    CVSROOT/commitinfo
A    CVSROOT/config
A    CVSROOT/taginfo
A    CVSROOT/modules
A    CVSROOT/notify
A    CVSROOT/verifymsg
A    CVSROOT/loginfo
A    stringsort.cpp
svn: Failed to add directory 'tools': an unversioned directory of the same name already exists
Damn SVN! Damn it!
The switch didn't work. The blasted thing switched src itself, but didn't switch any of the files in src,
or the folders below, and if I try to switch again...

Code: Select all

~/vs/vegastrike/src$ svn switch https://vegastrike.svn.sourceforge.net/svnroot/vegastrike/branches/reformat/vegastrike/src
svn: Two top-level reports with no target
I think they invented svn to waste the world's time.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: AI re-devlopment thread

Post by klauss »

You probably tried to switch to a different base. Your working copy base must match the target.

Ie, if I'm at trunk/src, I must switch to new trunk/src, not new trunk alone.

SVN isn't smart enough to detect those errors. Fortunately, it won't mess with any locally modified file. Unfortunately, fixing the repo after that mess is... complex.

When that happened to me once, I just backed up my locally modified files and checked out a fresh copy again. It was simpler than trying to fix it, even if it used more bandwidth.

EDIT: example of a correctly done switch:

Code: Select all

vegastrike-trunk/vegastrike$ svn switch http://.../branches/newbranch/vegastrike
at revision blah.
vegastrike-trunk/vegastrike$
example of a messed switch:

Code: Select all

vegastrike-trunk/vegastrike$ svn switch http://.../branches/newbranch
D vegastrike
D importantfile
D anotherfile
D everything
A yourmomma
U theworld
...
... ages and ages
^C
vegastrike-trunk/vegastrike$ svn switch http://.../trunk
Missing metadata or completely borked up working copy. Hang yourself now.
vegastrike-trunk/vegastrike$ DIE SVN DIE!
The problem: I had a working copy at /trunk/vegastrike, and I tried to switch it to /branches/newbranch, which was a copy of /trunk. Forgot the /vegastrike part, should have been /branches/newbranch/vegastrike. Ie: completely different crap. SVN tried to sync the two completely different trees and made a mess.

Fix:

Code: Select all

vegastrike-trunk/vegastrike$ copy <list-of-modified-files> ../<some-backup-folder>
vegastrike-trunk/vegastrike$ cd ..
vegastrike-trunk$ mv vegastrike vegastrike.bk
vegastrike-trunk$ svn co http://.../branches/newbranch vegastrike
A ...
A ...
...5 years later
vegastrike-trunk$ ls vegastrike
<all fine>
vegastrike-trunk$ cp <some-backup-folder>/files vegastrike/files
   ^ ie, restore your modified versions
vegastrike-trunk$ rm -rf vegastrike.bk
Please please... don't run any commands I type within [ code ] [ /code ] tags without checking and understanding what they do, they're written OTOH and only as examples.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: AI re-devlopment thread

Post by chuck_starchaser »

Gottcha. Thanks!
Yeah, when I realized my misake, yesterday, I tried to stop the switch with ctrl-c and wouldn't work; so I ctrl-z'ed it, but I guess that only suspends a process? Then I did an svn clean and tried doing the right switch, but I guess the suspended switch had some folders locked. yeah, better I start fresh.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: AI re-devlopment thread

Post by klauss »

Ya, Ctrl+Z only suspends, then you have to kill it:

Code: Select all

$ someprogram
... ^Z
$ jobs
[1] someprogram
$ kill %1
  ^ kill job 1
$ happiness
bash: happiness: command not found
But anyways, killing it wouldn't have fixed anything. Better start fresh.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: AI re-devlopment thread

Post by chuck_starchaser »

I'm not sure if this worked or not... What I did was,

Code: Select all

mv vegastrike vegastrike.bak
mkdir vegastrike
cd vegastrike
svn co https://vegastrike.svn.sourceforge.net/svnroot/vegastrike/branches/reformat/vegastrike
Looked like it worked, but now I tried svn status and svn info and ...

Code: Select all

~/vs/vegastrike$ svn status
svn: warning: '.' is not a working copy
~/vs/vegastrike$ svn info
svn: '.' is not a working copy
(Is there ever a way to win with svn?)
Last edited by chuck_starchaser on Tue Feb 09, 2010 8:16 pm, edited 1 time in total.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: AI re-devlopment thread

Post by klauss »

What you did wouldn't create a vegastrike/vegastrike folder?

Ie:

Code: Select all

$ mkdir vegastrike
$ cd vegastrike
vegastrike$ svn co ...
vegastrike$ ls
vegastrike/
vegastrike$ cd vegastrike
vegastrike/vegastrike$ svn info
?
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: AI re-devlopment thread

Post by chuck_starchaser »

LOL
You're right :D

EDIT:
Can I move the stuff up?, or is that going to mess everything up?

EDIT2:
Seems to be okay. Compiling...
Ehm... Do I need anything new besides --with-cubemaps for configure, --r.e. technique folders, etc.?
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: AI re-devlopment thread

Post by chuck_starchaser »

--with-cubemaps doesn't work!

Code: Select all

configure: WARNING: unrecognized options: --with-cubemaps
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: AI re-devlopment thread

Post by chuck_starchaser »

That should have been "./configure --enable-cubemap", got the straight dope from Klauss in chat.

So, the first few files are reformatted and committed for feedback.
aggressive.h
aggressive.cpp
comm_ai.h
comm_ai.cpp
communication.h
communication.cpp
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Re: AI re-devlopment thread

Post by pheonixstorm »

First 2 look much cleaner. I think the original used 2spaces on indent not sure on tab. Can you post both crusty config you are using? I think out coding style may be close enough for me to use yours, plus I want to see if there is much of a change between linux configs and win configs.
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: AI re-devlopment thread

Post by chuck_starchaser »

If you can hold on till late afternoon, I'll post everything.
Right now I'm in bed squirming in pain; I was off the morphine pills but I ran out of
ibuprofen, so I took the last 1 1/2 morphine tablets I had left, but they are not helping
yet and I can't walk to the pharmacy either... Just have to wait out the pain.
At least the bleeding seems to have stopped completely as of today.
A word of advice: Try not to need surgery.
Anyways, enough OT stuff in this AI thread; I'll make a new thread later today in the
Developers forum and post full instructions, batch files and examples.
Post Reply