Questions from a know-nothing beginning programmer/developer



  • Questions from a know-nothing beginning programmer/developer:

    I know some programming and mathematics, but I assume not even hardly enough to start reading and understanding TripleA's code in a functional way.

    But when I look at descriptions of how TripleA functions and think about things, I usually end up thinking "well, it could be done this way" or "what about this feature"? And I think, I can't fairly ask others to do work for stuff I want to see, especially when there's a lot of stuff like that.

    So I think about it, and I'm like . . . would it be all right to even ask on TripleA for others' opinion, especially considering I'm thinking if I do get the project going, I'll want money for it? But then I think, well, where else am I going to find the most people that know about all the issues that I'm going to be looking at, that might have better implementations, that know more about EVERYTHING?

    So boop, here I am, with questions.

    1. I'm planning on using Java because I understand it's portable between platforms. I'm a little concerned because what I'm looking at right now in terms of running an AI requires a load of calculations so that'll use a lot of processing power, and if I use looking up values from a precalculated chart that'll eat memory. But maybe I can build a new formula for predicting battle outcomes that works after a fashion - more than what was it, 2 x hit points + attack value? Er, not that I'm trying to dump on that formula, but I can't use it to do anything near generating a probability distribution. ANYWAYS, question. Java, yes? No? I have to learn all the ins and outs of a language anyways, maybe multiple, so I might as well go for whatever's best for the project.

    2. I feel that Axis and Allies gameplay is limited. Like, you get together with buddies in real life, you're eating takeout, doing your moves, watching TV, it's a good time. BUT I think a computer game doesn't have your buddies around, it's just you at your monitor, and even chat isn't the same. So I want to add a bunch of features. Some pretty simple, like each player in a game selects a "preference" then a game setup is selected based on those preferences. But also some really weird stuff, like if you have bad dice over time you build up a meter that you can use to favorably load your dice. And a LOT of other stuff I won't even get into for now (or I'd be here for days) So, question. These features are REALLY not at ALL what normal Axis and Allies plays like. Is there any interest in integrating "extra" features into TripleA? I mean really "extra".

    3. I haven't looked at TripleA's code at all. I've read secondhand descriptions of how some parts of it work. I don't plan on just trying to grab chunks of code out of TripleA, but what are thoughts on if I do look at it, see something I like, then want to use it? I think technically I'm in the clear as it's open source?

    4. What languages should I learn if I want to know how TripleA works, from top to bottom? Particularly, if things work out the way I'd like, I want someone to be able to use the program I'll be trying to build to play with someone using TripleA without the TripleA use needing to do anything differently on their end. I also want my program to be able to import .tsvgs, and export save game files as .tsvgs. (I figure the save data file on my end will require more data as I want to include stuff like timestamped chat logs and ability for viewers to add/read commentary).

    Thanks in advance for any answers. BTW, I'm not thinking my planned project will generate big bucks, right now I'm just thinking about how to build it as best I can in terms of system requirements, portability to mobile, and features that players want to see.


  • Admin

    (1) What is your ojbective?

    (2) There is a lot to work on before adding extra features. Features that are there, nice to have but not really used are things we'd like to see removed. Code is an overhead, it is a cost, it requires a consistent upkeep that must be payed. For code to remain, it must be contributing its share in useful features to be worth having.

    (3) See the GPLv3 license. Any code you use from TripleA needs to have a similar license (which means the source must be available and you cannot charge money for any of the derived products).

    (4) TripleA is almost all written in Java.

    TripleA without the TripleA use needing to do anything differently on their end. I also want my program to be able to import .tsvgs, and export save game files as .tsvgs. (I figure the save data file on my end will require more data as I want to include stuff like timestamped chat logs and ability for viewers to add/read commentary).

    Why not just modify TripleA?
    Reading a .tsvg file will require a lot of the TripleA code to be brought in.

    tl;dr, a lot of stuff seems easy, but it's a lot of work. Even cleaning up just a few of the TripleA class files can be a few hours of work, and there are hundreds of them. TripleA is the result of 15 years+ of programming and perhaps somewhere around 5,000-10,000 hours of cumulative development time. That is not to say a lot of it could not be done with modern programming faster, but it's generally always more complicated than it seems.



  • @LaFayette Thanks for your response.

    1. Objective is learning code, mathematics, and business practices necessary to release a program with the features I want. I've read the vast majority of indie programming projects don't return what's spent on investment, but I figure the experience will be valuable.

    2. I'm interested in "cost of upkeep". Do you mean each time something is changed, all existing code has to be tested to see if it still works? Or that it's difficult to get new people working on the project as they have to read up on what all the existing code does? Or do you mean memory usage, whether disk space or operations per second? Or all of the above? Or something else?

    3. Thanks for the tip about the GPLv3 license. If I copied big chunks of code with minimal modification that would be out. But what if I looked at TripleA's code (I haven't yet) and saw a technique or a method I thought useful? Not copying chunks of code, but looking at the method.

    Specifically, I think (I haven't opened TripleA's code so I don't know for sure) that there's a code for predicting battle outcomes that's 2 x hit points plus attack/defense power? I don't plan to use that, but if I did, would that be prohibited?

    Or suppose I looked at TripleA's code and liked its implementation for how to check if fighters have legal flight range. If I remember, last time I saw validation in action in TripleA, my implementation might work differently. (Way I plan to have it work, have a list of legal landing territories, another list of allied carriers that have available space on them, and another list of friendly carriers, identifying each friendly carrier specifically and listing it twice. Then I take the active stack of fighters and as it's moved each fighter generates a list of possible landing zones. Then I match up the lists and make sure any particular carrier doesn't have to "split", and along the way add in things like fighters can't plan to land on a retreating carrier, other legal move requirements).

    Perhaps it would be better if I just didn't look at TripleA's code at all?

    1. Thanks for the tip about Java.

    Why not just modify TripleA? For some features I'm planning, I'll be putting a lot of work in, and I want ownership of that work. For other parts, I don't know how that would work with the GPLv3 (I'm not saying "I don't think it would work", I mean literally I don't know how it works.)

    "Reading a .tsvg will require a lot of the TripleA code" - would it? I don't know. You know the GPLv3, you know the code, tell me what you think.

    Say someone builds a map in TripleA, they have to specify what territories and sea zones are connected, properties of canals/straits. Then there's things like national objectives, technology, units and properties, graphics for every visual, other stuff.

    Say I want to read a .tsvg. Is it like each map has an identifer tag, TripleA's .tsvg's first line is an identifier tag, then all the following .tsvg contains data that's formatted according to that identifier? If I want to represent that .tsvg in TripleA then that has to hook up to how TripleA represents files.

    But what I have in mind is something like how there's Google spreadsheets, Lotus, and Excel spreadsheets. There's differences between formats, but files can be converted from one spreadsheet to another.

    So what I have in mind is on my end the program I'm building reads the data off the .tsvg, but treats it as raw data. Then the program I'm building uses its own local files to create the map. That includes graphics, map rules, territory/sea zone connectivity, the whole deal.

    Which is actually one of the features I want to build in for customizable user experience. I know this might sound silly. But let's say you like kittens, bunnies, unicorns, and pizza. Instead of playing a game about WW2 and blowing stuff up, you want to play a game in which rival pizza delivery services run by said animals compete for delivery areas. You customize your experience by selecting your "skin". So for one user, they're putting fighters on carriers and moving those into the Pacific. For another user, the exact same in-game action means putting kittens on unicorns and moving them into the Dark Forest.

    It could be that TripleA's .tsvg file doesn't work at all that way, to the point that it would be functionally impossible to move save game files between one program and another. Well, if that's how it is, that's how it is. But is it that way?

    I have no doubt it's a lot of work. Right now it's like there's a wall of things that I don't know about. But I know behind that wall is another bigger wall that I can't even see right now because I haven't broken through that first wall yet. Then maybe more walls behind that.

    Thanks for any answers!



  • @LaFayette said in Questions from a know-nothing beginning programmer/developer:

    which means the source must be available and you cannot charge money for any of the derived products

    Just want to point out that you can charge money for a GPLv3 product or derivations. But you must provide the source code to all of your customers under the GPLv3 and so they can take the same source code and share it, build it, sell it with whoever they want.


  • Admin

    (1) Contributing to TripleA is very valuable in a number of ways. There is an experience boost, you learn to work on a distributed team, exposure to different ideas, tools & technologies. It has helped me professionally without a doubt.

    (2) Any existing code must be maintained. Code interacts with other code, well designed code will stay module but less poorly designed code interacts with lots of other code. To change one thing, you need to trace down all of these transitive interactions. The more there is, the more there is to interact with. In the worst case, code complexity can have combinatoric growth (which is incredibly fast). Then beyond that, there is the sheer volume to understand, read through and look over.

    (3) If you copied any portion of TripleA, with any modification, your entire product must also then be GPLv3.

    Specifically, I think (I haven't opened TripleA's code so I don't know for sure) that there's a code for predicting battle outcomes that's 2 x hit points plus attack/defense power? I don't plan to use that, but if I did, would that be prohibited?

    Nothing stops you from looking. Algorithms AFAIK are not subject to copyright nor IP.

    Why not just modify TripleA? For some features I'm planning, I'll be putting a lot of work in,

    That's a given. Just my unsolicited advice to you, multiply your time expectations by about 7 or 9. When you are fresh on a topic, everything seems like it should take 3-6 months. That is largely because a person does not yet realize how detailed and how complex these problems are.

    With respect to the walls you cannot see, the one in front of you is probably 3x the size you think, the one behind is twice. So a magnitude or even two more work than you would think is actually really reasonable. There is a reason why software projects often run over budget and schedule : ) It's not that you missed one requirement out of 3, but it's that you missed a big one that has 10 sub-requirements under it, increasing work by magnitudes, often not just 10% more, but 10x more.

    "Reading a .tsvg will require a lot of the TripleA code" - would it? I don't know.

    Yes, a .tsvg file is a serialized form of java objects. It's a binary format that java can map to and from objects. You would literally need the same objects to be able to read it. It's actually a major development pain point as there are large tracts of code that cannot be safely changed because of this.


  • Admin

    Re: code as a cost

    Very salient, read this article today, check section number (2):
    https://martinrue.com/my-engineering-axioms/

    "2. Your product is an asset, but code is a liability."



  • I'm reading up on programming and mathematics but especially in stuff I'm reading about programming, issues that come up in actual real-life practice aren't addressed. (Sure, there's stuff like "this will make your program not work", but nothing like "if you run this ten thousand times instead of one your load time will run to six real-time seconds, which will make users not want to use the program, so you should do this other thing instead.")

    Okay, so a .tsvg is a serialized form of java objects, binary format that java can map to and from objects. I don't know for sure, but I imagine that would be more convenient in a lot of ways than creating a save file that records game history/position as spreadsheet-readable data, and loading that data into the program as I had thought it might work.

    That said, is there a particular reason (other than a chunk of code not really necessary to functionality) that save game files don't work that way? Say the data files were spreadsheet-readable with one line indicating what map/ruleset to use; would that require a long load time (even a few real-time seconds)? Or are there out-of-memory issues, or are there possibly issues with multi-threading? Or something other specific barrier? Sure, I can read up on how to do all those things, but I haven't found any specialist text that gives practical advice, and basic-level texts just don't advise on practical issues. What I'm worried about is, I could spend a lot of time building this whole thing, and I could get it to work after a fashion, but it might just crash into one of these barriers. Like if it requires 16 GB of RAM that means I can't get it to work on most phones, if it requires five second load times that's going to turn off a lot of users - even if the code works in abstract, the problem is it has to work in practice for different users.

    If it IS just basically "it's a big ugly chunk of code that complicates things but there's no problem with performance, including memory usage or load times", then phew. Be a problem to deal with, but an addressable one.

    Also, noted on cautions about unknown issues, time, &c. I've read a lot of similar cautions in books for starting programmers, developers, but also small businesses, business in general, etc. The advice I've read (and how I'd say it works in real life too so far as I've ever seen, and how I generally advise others) is - it's fine to have good ideas, but it's about practical execution; if you have complicated things (whether code, or business expenses that you don't really need) then cutting those out to streamline the code/business means fewer things can go wrong with the process. So if it seemed I wasn't taking those cautions seriously when I'm talking about all these features, that's on me. I do take it seriously.

    Thanks again for responses!


  • Admin

    That said, is there a particular reason (other than a chunk of code not really necessary to functionality) that save game files don't work that way?

    Java serialization was once popular, it was an initial design decision to use it, it was somewhat easy. We would actually like for save games to work more like you have described. It's a very large project, that is all, and we have a large backlog of small and large projects that we are working on and collectively there is not that much development labor available.

    Re: performance requirements

    These are the wrong things to focus on. First focus on functionality, what are you going to built? What value will it provide, how will it be used? You need a good product for anything else to matter. Then I'd encourage to stop worrying about specs. Simple and well done architectures are fast and perform well. Simple code is usually fast code. Once you have a reasonable design in place and functioning, then you can start analyzing where the performance bottlenecks are and where to go to optimize. It's a ways to get to that point, and once you are there the process is to measure, change, repeat. Humans have generally very bad intuitions for where performance problems will arise. It's also easy to try and fix all performance problems as optimization problems when they are really design problems. One can look at a block of code and wonder "how can I make this faster", and sometimes the right answer is, "how can I avoid needing to execute this in the first place?" That is why keeping things simple and working is very important, it lets you reason about what your code is doing. For example TripleA does a lot of calculations twice, why? Because there are 15 layers of call indirection separating the two which creates several thousands of lines of code in between the duplication.

    Bottom line

    OUr time is short in just about every way imaginable. I'm pretty sure and somewhat regrettfully going to say, if you want something that interoperates with TripleA, it's potentially one of and likely all of: untractable and/or a truly huge project

    We have wanted to for example to allow TripleA to run on web browsers, or phones. That project is probably 3-8 years away from being completed if it were started today.


Log in to reply