Author Topic: Coders HERE!!  (Read 26828 times)

modman

  • Guest
Re: Coders HERE!!
« Reply #25 on: 8 November 2008, 19:34:33 »
Just edit your post.

eserlxl

  • Guest
Re: Coders HERE!!
« Reply #26 on: 10 November 2008, 15:14:28 »
Unfortunately, I have not enough knowledge about graphical/physics engine. Therefore I decided to start with AI coding.

Here's the new AI script which gives the user to change AI behaviour without any coding or compiling. I will distriubte it and modified code soon, but now I wonder your comments.

Code: [Select]
#Ai Script for Glest by eserlxl

(The_format_is_important_for_now)
harvesterPercent 30
maxBuildRadius 60
minMinWarriors 7
maxMinWarriors 50
minStaticResources 10
minConsumableResources 20
maxExpansions 4
villageRadius 50
EMERGENCY_WORKERS 6
WORKER_COUNT0 12
WORKER_COUNT 10
WORKER_COUNT2 15
WORKER_RATIO1 0.2
WORKER_RATIO2 0.3
WARRIOR_COUNT 40
WARRIOR_RATIO1 0.2
WARRIOR_RATIO2 0.3
BUILDING_COUNT1 6
BUILDING_COUNT2 10
BUILDING_RATIO 0.2

These configurations can also be changed through the game. In other words, the AI can react to your capacity. AI strategy can be harder or easier according to your performance in the same game.

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Coders HERE!!
« Reply #27 on: 11 November 2008, 07:54:01 »
Thanks exerlxl. This should go into a new topic.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

eserlxl

  • Guest
Re: Coders HERE!!
« Reply #28 on: 11 November 2008, 08:21:56 »
Yes, I will do it immediately.

modman

  • Guest
Re: Coders HERE!!
« Reply #29 on: 4 January 2009, 04:27:21 »
I want to switch myself to medium or whatever.  I can create semi-simple text-based games.  The purpose of this topic was of course to find help for the GAE Team, and that I will not be.  Sorry.

I have taken a look at the source, and, yea...  :o
« Last Edit: 8 February 2009, 00:19:04 by modman »

ZaggyDad

  • Guest
Re: Coders HERE!!
« Reply #30 on: 30 January 2009, 03:34:31 »
I want to switch myself to medium or whatever.  I can create semi-simple text-based games.  The purpose of this topic was of course to find help for the GAE Team, and that I will not be.  Sorry.

You should try taking a shot at a text-based realtime strategy game. ;)

Why can't you help us poor lonely souls? ;D

modman

  • Guest
Re: Coders HERE!!
« Reply #31 on: 31 January 2009, 03:30:16 »
I guess I have the same problem as Omega, as well as WAY too many projects going on right now.
The reason I come to the forums is so I can check up on topics that interest me, mostly Dark Magic and Undeads (not so much).

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Coders HERE!!
« Reply #32 on: 31 January 2009, 10:35:37 »
My projects differ though. I have started to program my own FPS, but I can't physically go beyond planning until after I finish the mods I'm working on. Also, I got to add to the fact the I don't know Glest's engine that well (documentation would be nice). I'm not sure what I could do, but seeing how I've begun to be able to do things including shaders, OpenGL, vectors, pointers, references, 3D programming. I'm not that good, but improving at a good pace.

The other problem: I am used to Irricht for 3D (it has everything from good 2D/3D format support, GUI, animation, collision, video, controls, IO, and even a XML parser which is small (64KB!) and easy to use).

I'll take so time to improve glest sometime, but I'm actually a whole lot busier than Modman!
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

modman

  • Guest
Re: Coders HERE!!
« Reply #33 on: 31 January 2009, 16:16:53 »
OK so at least someone gets my situation; this is why everything takes so long for me, and add in a delay for school too.

I would to see what an example of a text-based RTS game looks like; I doubt it's possible.

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Coders HERE!!
« Reply #34 on: 1 February 2009, 01:26:42 »
Quote
I would to see what an example of a text-based RTS game looks like; I doubt it's possible.
ASCII art and keyboard controls. It wouldn't be large scale but I think it would be possible. Not that I'd jump to do a project like that in the near future.

Also Irrlicht is an awesome engine.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Coders HERE!!
« Reply #35 on: 1 February 2009, 08:48:22 »
Also Irrlicht is an awesome engine.
Yeah. I looked at a bunch of things including Delta3D, OGRE, and Lirricht before choosing what I'd use.

To help my coding skills, does anyone know some very good complete guides for either AI or Networking? I am very noobish there, and I prefer complete guides that you can download and view offline (eBooks, PDFs, CHM, zipped HTML, etc;). I prefer legal downloads, just to make a point (not torrents).

And any resources that could have learn programming for detecting when you hit something would be nice (FPS style). That's probably explained somewhere in an AI guide. I've tried to download some, but had broken links (30 no-activity limit). Guess AI books aren't too popular...
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

modman

  • Guest
Re: Coders HERE!!
« Reply #36 on: 1 February 2009, 20:43:23 »
I just saw some awesome PDF and it was on AI.  But for staarters, you want the AI to be as efficiant as possible, and also to do basically the same things as a human does.  For example, Glest AI expands if the newer resources are as far away from the base as the diameter of the origanal town (I believe).  Simple maesures to tell the AI what to do.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Coders HERE!!
« Reply #37 on: 3 February 2009, 15:50:26 »
Does this PDF have a download link to it??? Doesn't do me any good to just hear about it. I need to actually see it!
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

modman

  • Guest
Re: Coders HERE!!
« Reply #38 on: 8 February 2009, 00:24:48 »
I'm sooo sorry >:( .This is the second time I forgot to post a link to the document! >:(
Here it is.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Coders HERE!!
« Reply #39 on: 8 February 2009, 09:58:08 »
Hmph, I was more looking for something like an ebook. Too many broken links when I tried to look myself... Bah!  :P
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

modman

  • Guest
Re: Coders HERE!!
« Reply #40 on: 9 February 2009, 02:47:33 »
Works fine for me. ??? ::)

PolitikerNEU

  • Guest
Re: Coders HERE!!
« Reply #41 on: 26 February 2009, 14:51:15 »
Hello!

I think I am intermediate/advanced - in university we only use java and I have never coded anything beside console applications coded some small programs in swing, soon (in Software Engineering and Project Management) we start programming a bigger Gui-Project, but still in java.
« Last Edit: 8 April 2009, 11:30:14 by PolitikerNEU »

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Coders HERE!!
« Reply #42 on: 1 March 2009, 11:47:49 »
Most universities start very slow, and console is really the only way to start, even though most proper programs will not use the console as a main screen.

Still Java isn't too different from C++ (or so I hear). It's deprived derived from it after all. (Although really, intermidiate/advanced from console only?)

[EDIT: By Daniel, changed "deprived" to "derived" as you probably meant :) ]
« Last Edit: 6 March 2009, 08:55:59 by daniel.santos »
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

PolitikerNEU

  • Guest
Re: Coders HERE!!
« Reply #43 on: 1 March 2009, 12:06:36 »
Yeah, java is not really different from C++, but c++ has some features java hasn't (like pointers, multi-inheritance etc.) - and templates are totally different.

I don't know how this classification works so I might just be intermediate - but I had object-oriented programming and algorithms and data structures (I and II) (and, of course, introduction to programming) and in fact I think I'll never have a lecture about gui-programming in university although we don't have any special lectures of gui-programming, we do a bit of it in university.
« Last Edit: 8 April 2009, 11:31:24 by PolitikerNEU »

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Coders HERE!!
« Reply #44 on: 2 March 2009, 07:25:03 »
There are enough differences that you will need to read/learn how to program in Java if you are a c++ programmer but not enough that it will seem unfamiliar.

The second programming unit at my uni (object-oriented programming) uses GUI programming with C#.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

charlieg

  • Guest
Re: Coders HERE!!
« Reply #45 on: 3 March 2009, 00:59:10 »
Yeah, java is not really different from C++, but c++ has some features java hasn't (like pointers, multi-inheritance etc.) - and templates are totally different.
Java object references are more like pointers than they are C++ objects.

i.e. Java

Code: [Select]
MyType foo = new foo();
MyType foo2 = foo; // foo == foo2, point to the same object
foo = null; // foo2 still relevant

C++

Code: [Select]
MyType foo; // no constructor required
MyType foo2 = foo; // foo2 is a _copy_ of foo, not the same object
MyType *p1 = &foo;
MyType *p2 = *p1; // more similar to Java object references

daniel.santos

  • Guest
Re: Coders HERE!!
« Reply #46 on: 6 March 2009, 09:22:02 »
Java object references are more like pointers than they are C++ objects.
Yea.  The main difference is that C++ doesn't give you a NullPointerException() automatically when you attempt to use a null pointer.  In fact, if you attempt to use a bad pointer, the results are "undefined" (a specification you'll see often in C++ and C).  Finally, C and C++ give you the concept of pointer arithmetic.

Code: [Select]
for(char *p = "hello"; *p; ++p) {
    putc(*p);
}
This snippet just prints out "hello" to the console (without a carriage return).  What this snippet essentially does is to allocate a null-terminated C string in the data segment of your application's executable.  The "null-terminated string" means simply that the ascii bytes of the text will appear in memory followed by a zero value to indicate the end of the string of characters.  So I assign a char pointer named "p" to the address of the first character in this string and I iterate through the loop for as long as the value at the address pointed to by p is non-null (the expression "*p" is the same as converting the value "*p" to a boolean that's false if zero and true if non-zero).  Finally, by saying "++p", I'm using pointer arithmatic to increase the pointer.  The pointer is increased by the size of the object type it's pointing to.  In this case, a "char" is only one byte in size.

If this were "int *p = {5, 4, 3, 0};" instead, then each time I call "++p", the pointer will increase by 4 since that is the size of an int (at least if you're using either 32 bit or 64 bit C/C++, in 16-bits, it was 2 bytes in size -- or the "long" type was, I forget now!).

So in short, C and C++ are much dirtier than Java.  Java is a pure object oriented language, something very few other languages these days can boast.  This is simply because everthying derives from java.lang.Object.  Perhaps C# could claim that if it wasn't written by m$, but that very fact (in my heart and mind) immediately causes me to dismiss it as a very "impure" entity :).  So anyway, everything (except for primitives) in Java is an object.  C++ actually has no real distinctions between objects and primitives.  This, each of these is considered a call to a constructor:
Code: [Select]
int *j = new int(5);
MyClass *o = new MyClass(some, parameters);

// or, using an uglier "create a temporary object and then use an assignment operator" approach

int j = int(5);
MyClass o = new MyClass(some, parameters);

// and finally, the "just initialize the object using the constructor I specify" approach:

int j(5);
MyClass o(some, parameters);
The difference being that "int" is a built in type.
Disclaimer: I haven't actually tested this code, but I believe it's valid.

Many of the shortcomings of C++ have been getting filled in here and there over the past decade or so in a most quaint fashion.  Overall, if I had to compare the two, I would say that the primary difference these days is that Java still uses more memory (it's designed to) and in some areas, offers inadequate performance guarantees while C++ is still, at it's core, ugly :).  But C & C++ is a statically compiled language (there are a few dynamic optimization runtimes out there, but they are experimental) while Java is dynamically compiled.  This means that Java programs run slower when they start, but that they have both the data and the code when they are given an opportunity to compile and by analysing how functions are being used (when they get used a lot) it can compile multiple optimized versions of those functions specific to the data sets that it's being called with, thereby providing optimization opportunities that do not exist in statically compiled languages.  However, that also means that it runs slower at first and performance increases as you run the app.  With C and C++, the performance is almost identicle at both start and later in it's execution (except when data has to be loaded from the disk and is later cached by the OS's kernel).

I'm a recent student of Scott Meyer's Effective C++ book (there's two more books of his I need to get as well, More Effective C++ and Effective STL).  These books are not intended for the C++ initiate, but I would recommend them as soon as you begin to feel comfortable with the language.

Finally, the new C++ specification is to be finalized this year, called C++0x (the 0x is because it was supposed to be released sometime in the 1st decade of 2000, but before 2010 -- as it turns out, just slightly before 2010!).  This introduces a mass of new language features that I'm SO behind on that it's just silly!

daniel.santos

  • Guest
Re: Coders HERE!!
« Reply #47 on: 6 March 2009, 11:23:20 »
And any resources that could have learn programming for detecting when you hit something would be nice (FPS style)...
I'm not too well versed in this arena yet, but I did the ODE in a nutshell tutorial which demonstrate's collision detection using their library.  Ideally, you're object definitions will just be a reference to the mesh data of your 3d objects.  Or for the lower impact approach, just a box that encloses them.  But for the ultra-realistic, I would feed it only your model data.  This doesn't take into account other artifacts of your weapon's projectile, like "near-miss damage" (Many real life military weapons don't even require a direct hit to do substantial damage.  Sadly, I learned this from a buddy who came back from Iraq after manning the the .50 caliber mounted on a humvee who said you could miss by a foot and it would still rip somebody's arm).

But back to happier topics, give that ODE tutorial a try.
« Last Edit: 5 April 2016, 15:35:11 by filux »

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Coders HERE!!
« Reply #48 on: 7 March 2009, 00:49:18 »
Interesting fact: My software development tutor worked on the optimisation of the Just in Time Java compiler.

Another difference is that Java uses common types over different systems.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Coders HERE!!
« Reply #49 on: 8 March 2009, 21:38:23 »
you could miss by a foot and it would still rip somebody's arm.
Thank god glest doesn't have any weapons like this, eh?
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert