Thread: Empire AI in C#

  1. #16
    Anti-Terrorist
    Join Date
    Aug 2001
    Location
    mming, Game DevelopmentCSR >&<>&2Minimization of boolean functions, PROM,PLA design >&0>&WA, USA guitar, dogsCommercial Aviation >&>>&USAProgramming
    Posts
    742
    I'd like to know if nv knows XML and SOAP. I hear that these are the best languages for web applications, infact after I learn C++ which will take some time yet, I plan to study C# and just as importantly XML.

    In my opinion the question isn't C++, it's more C than anything. What I mean is that you have the definition of C, than you have C++,C#,Java, etc. All these lanuages are abstractions of C. Anyway C++ programmers do not solely depend on STL and the definition. Instead they use vendor libraries for graphics. I would think that the would invalidate any comparison of C++ with any other lanuages because most people think of C++ in terms of it's definition. This is not how it is being used though.
    I compile code with:
    Visual Studio.NET beta2

  2. #17
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,263
    which is in fact the beauty of it...

  3. #18
    Registered User minime6696's Avatar
    Join Date
    Aug 2001
    Posts
    267

    Smile okay okay

    Okay everyone, I wasnt saying its impossible to make a game, I can make a game in java. I was trying to say if you want to be a sierious programmer you can't be doing Java or C#... Unless you're in webpage design. Like I was saying people shouldent go to net languages and BASIC becouse they look promising and easy results, it wont happen quite that easy...

    And I am makking a language, i've been working on it 2 days now, it allready has import libraries functions, variables, arrays, winAPI, Console, and starting on OpenGL/DirectX (Once I have data structures). See what can be done in C++ .

    If anyone is interested, The lang should be done in about a week, of course its nice to have other peeps helping with import libz . I'm not sure what I will call it, prolly something like cppapplet or something. I would never say "USe cppapplet and not C++", its just a nice little thing for its purpose: Portabuility, and of course net preofrmance, this has a lot more power than a lot of other "net languages". It is precompiled @ runtime and then partly interpreted, it has some nice features, and some annoying ones! If anyone is interested email me or goto the post im about to put up about it.

    SPH

  4. #19
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    I'd like to know if nv knows XML and SOAP.
    I know XML. It's not a language, but rather a standard to define
    standards. It's a way of implementing a unified data transfer.

    From the draft W3C specification: SOAP is a lightweight protocol
    for exchange of information in a decentralized, distributed
    environment. It is an XML based protocol that consists of three
    parts: an envelope that defines a framework for describing what
    is in a message and how to process it, a set of encoding rules for
    expressing instances of application-defined datatypes, and a
    convention for representing remote procedure calls and
    responses.


    I was trying to say if you want to be a serious programmer you can't be doing Java or C#... Unless you're in webpage design.
    hm... damn, I'm non-existent. I can't exist.

    I agree with you that C++ is a better choice for most applications
    that doesn't need to be cross-platform. But you will have to learn
    that a 'serious' programmer is not someone who does what he
    likes. A serious programmer should be able to do whatever his
    employer likes. And that might well be VB, Java or maybe C#.

    .NET has nothing, absolutly nothing to do with the net. It's just
    a name. You CANNOT do webpages with .NET alone. You can
    do it in ASP.NET, as well as you can make webpages in ASP
    now. You can write C++.NET apps as well as you can write
    C++ apps now. The .NET should make it easier, that's it.

    And actually, for some occasions, Visual Basic is the tool that
    gets the job done in half the time of a C++ programm.

    So if a serious programmer has the option of doing his duty
    in a week, or doing a load of overtime and maybe working
    weekends for doing it in C++, do you really think he'd do it
    in C++ ?

    And what if you have no other choice ? What will the serious
    programmer do if he has to create a stored procedure for the
    corporations oracle database ? Quit his job ?

    It's one thing to know what you like. But in reality, the best
    allround tool might not be the best tool for a special job.
    And serious people use the best tool for the job.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  5. #20
    Registered User
    Join Date
    Aug 2001
    Posts
    47

    Languages without pointers...

    Question: All versions of VB (and most BASIC languages) don't have pointers. How do you get anything done?! I know there's the VarPtr function and you can use, in conjunction with CopyMemoryRead, and CopyMemoryWrite, but - like everyone's been saying - you should use the right tool for the right job, and it doesn't seem to me that using WIndows API functions as pseudo-pointers is using the right tool for the right job when many other languages (C++, C, Java, and I assume C#) do have true pointers. I understand why you'd use VB - it makes creating Windows GUIs very, very easy. But most actual logic code, I find, is much <i>harder</i> to do in VB. So how do you "pros" do those kinds of things? Just with lots of DLLs; COM objects, perhaps?

  6. #21
    Registered User
    Join Date
    Aug 2001
    Posts
    411
    I used to play the game Conflict for hours on end aginst my dad, we once had a game go on fo 13 hours. Now a revamp of that game would be nice. It was a turn based strat, with a limited number of vehicles and ground types.

  7. #22
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    >Question: All versions of VB (and most BASIC languages) don't have pointers.


    Question: What do you need pointers for ?

    References in function parameters: ByRef keyword in VB
    Linked List: Ready to use classes in VB
    String manipulation: Ready to use classes in VB
    Dynamic memory allocation: keyword redim can change arrays to any size dynamically

    So for easy tasks that involve user interaction, VB can save
    a lot of time. I hate it, but it has it's uses.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  8. #23
    Registered User
    Join Date
    Aug 2001
    Posts
    47
    nvoigt: You're right about linked lists, dynamic memory allocation, and references. I'm more comfortable with pointers to do those things, but you're right; functions do exist in VB.

    But how, then, do you deal with trees? With the exception of simple binary trees (which you can use a linear array for), the only way I can think of doing that in VB is to use a "pseudo-pointer" long integer in a struct, and use the kludgy methods I mentioned before.

    And, even with linked lists, whenever you want to do an insertion, you can't just change the values of a few pointers; you have to expand the array size by 1, shift everything after the insertion point down, and then put your item in.

    So, basically, what it comes down to is this: If VB had pointers, it would be great. Even the speed concerns aren't as huge nowadays, assuming you have anything better than the Learning Edition, because you can compile to machine code - not the best machine code, I'm sure, but machine code nonetheless, so your code doesn't need to be interpreted - even if it still does need the runtimes. But the lack of pointers is the one thing I simply don't understand. How pople can deal with VB for anything more complicated than a "vector" type data structure is beyond me.

    The only technique I can think of is to program all your logic code in C++, and use it from within VB in the form of DLLs. How common is that technique?

  9. #24
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Well, actually, VB has the same support for pointers Java and C#
    have. All Objects are managed via pointers. Consider this lines
    and the New keyword:

    Dim db as Database

    Set db = new Database

    Very valid VB and in fact the only way.
    So in theory you could create anything that requires pointers
    in VB, too. But normally, for a typical VB program, no complex
    structures are required. There are lots of programs that never
    use a list or tree or hash table. Those programs using these
    constructs almost always require speed. And speed is a
    critical drawback of VB. As a user-interface it's acceptable.
    As a server or running applications without anything that's even
    slower ( user, database... ) it's next to unusable when speed
    is required.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  10. #25
    Registered User
    Join Date
    Aug 2001
    Posts
    47
    So I wasn't mistaken; I really was just running head-first into VB-s limitations. I guess I'm just into the kind of programming that VB isn't designed for! (I was into DirectDraw 7 in Visual Basic. BAAD idea!! VB isn't for games! Good thing I'm now in C++.)

    But I guess that's to be expected.

    How many high-school juniors that program make business apps?

  11. #26
    Anti-Terrorist
    Join Date
    Aug 2001
    Location
    mming, Game DevelopmentCSR >&<>&2Minimization of boolean functions, PROM,PLA design >&0>&WA, USA guitar, dogsCommercial Aviation >&>>&USAProgramming
    Posts
    742
    From what I've heard about VB, it is a RAD language. Rapid Application Development.

    VB.NET is a lot more powerful than VB6. It is an OOP language now but C# likely is better. The literature for these brand new languages is just comming out now.
    I compile code with:
    Visual Studio.NET beta2

  12. #27
    Registered User
    Join Date
    Aug 2001
    Posts
    4
    I don't know how the heck this became a rant, but back to the original post:

    >> I will post the game AI's class here, so everyone can
    >> derive an AI of their own. In the end we could have a
    >> nice AI fight... anyone interested ?

    Anyone heard of C-Robots? (or P-robots for Pascal). It's kind of the same idea, where you program a robot to fight other programmer's robots. It's pretty ancienct though, and I haven't seen it in awhile. Might be kindof fun if someone could find it...

  13. #28
    Blank
    Join Date
    Aug 2001
    Posts
    1,034
    You can do trees with arrays, to make it dynamic you could resize the array but I have a feeling it would be very very ugly.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple space combat AI
    By VirtualAce in forum Game Programming
    Replies: 5
    Last Post: 01-06-2009, 12:54 AM
  2. chess ai contest
    By Raven Arkadon in forum Contests Board
    Replies: 7
    Last Post: 07-09-2005, 06:38 AM
  3. What's Your Favorite Empire?
    By Unregd in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 03-28-2003, 12:55 PM
  4. Game Design Topic #1 - AI Behavior
    By TechWins in forum Game Programming
    Replies: 13
    Last Post: 10-11-2002, 10:35 AM
  5. Technique of all board-like games?
    By Nutshell in forum Game Programming
    Replies: 28
    Last Post: 04-24-2002, 08:19 AM