Recent Posts

Pages: 1 [2] 3 4 ... 10
11
Projects / Re: OP2Archive Application Development
« Last post by leeor_net on April 21, 2018, 04:58:17 PM »
In reference to Hooman's comment about subfolders in VOL files:

Quote
We may want to consider the possibility of subfolders within VOL files, and how the path component interacts with the filename.

It got me thinking (especially with Brett's comments about OP2-Landlord), are the VOL files absolutely 100% required or is it possible to replace them with standard ZIP files? Is this something that our recent mods are capable of implementing or is this hard coded into the main executable?
12
Outpost 2 Mapper / Re: Better design for representing OP2 Maps in OP2Utility
« Last post by leeor_net on April 20, 2018, 03:38:06 PM »
If we have an enumerated type to describe a cell type, any function that gets a cell type should return an enumerated type. This is a case of making an interface hard to use.

I don't remember where I got the CellType enumeration from -- probably from the VisualBasic code that I stole adapted from the Visual Basic map editor sources. If this type can be used outside of the Outpost2DLL then we should make it so... maybe call it OP2Core or OP2Common or something equally inane.
13
Outpost 2 Mapper / Better design for representing OP2 Maps in OP2Utility
« Last post by Vagabond on April 19, 2018, 03:58:59 AM »
Hey everyone,

Currently OP2Utility only has the ability to read a map. I'm looking at expanding this to add a save function so it can be used with the mapper. Currently the MapData constructor is responsible for loading a map via filename or stream.

I'm thinking for the big picture strategy:

  • struct MapData - A data transfer object (DTO) that contains the data for a map and simple get/set functions if appropriate.
  • class MapReader - Responsbile for reading a saved game or map into the struct MapData. This code is already written and just needs to be moved out of the MapData struct into a separate class.
  • class MapWriter - Responsbile for writing a map to disk. (I'm not planning to support writing a saved game)

In the long term we will probably want a couple of functions that manipulate the MapData after it is loaded in more complex ways. For example, since tilesets are stored in MapData, you might want a function that adds a new tileset with default settings to the map. This could be a function attached to the MapData struct or it could be standalone function that works on the MapData, keeping MapData more of a DTO.

-----
EDIT

I also noted in op2-landlord, the enum CellType is used. This enum is also defined in Outpost2DLL. Are we wanting to recreate the enum outside of Outpost2DLL as it doesn't make sense to reference the entire project just for one enum? If so, I'll update OP2Utility to include a copy of the enum.

Right now OP2Utility's MapData just returns an int for cellType without telling the user what kind of cell it is via the enum.

Thoughts?

Thanks,
Brett
14
Test/Spam Forum / Re: Blight Discovered?
« Last post by Arklon on April 18, 2018, 07:46:24 PM »
That's a far cry from the Blight:

Quote
From the Plymouth Novella

"What's this?" She pointed at an angular shape inside the cell.

"We don't know exactly, but it isn't natural.  We think it's what makes this thing reproduce at its fantastic rate, gives it the metabolism to tear apart rock like tissue-paper."

She licked her upper lip.  "There were references in some of the Earth databases to 'accelerated cells,' organic cells with some of their internal machinery replaced with real machinery of the manmade variety, self-replicating of course.  The experiments were very secret, and no details were available in any of the literature I was able to access."

The "internal machinery replaced with real machinery of the manmade variety" bit should have been worded in a less silly way, but the overall concept of engineering artificial organelles, enzymes, or whatever other biomolecular structures, which are vastly more efficient and effective than anything that exists in nature, is plenty plausible.

As far as what the article is talking about is concerned, though, we're just talking about a newly-discovered enzyme that breaks down polymers of polyethylene terephthalate:
Quote
(We really need a way to have white backgrounds for transparent images like this)

This isn't even remotely close to being the most complex organic molecule ever, so this enzyme isn't the most complicated enzyme to ever have evolved, either. It was only a matter of time until microbes started evolving enzymes like this, really. We've been dumping metric shit tons of plastics into the environment, which gives microbes ample opportunity to come into contact with them.
15
Outpost 2 Update / Re: Updates for Outpost 2 1.3.7
« Last post by Arklon on April 18, 2018, 06:53:54 PM »
Arklon,

Approximately how long do you need before it is ready? I think it makes more sense to delay releasing 1.3.7 until you are ready unless it is going to be a long time.

-Brett

At this rate, about the combined lifespans of several universes' worth of time or so.
16
Test/Spam Forum / Blight Discovered?
« Last post by leeor_net on April 18, 2018, 05:34:44 PM »
So... this happened.
17
Computers & Programming General / Re: Learning C through a fun project?
« Last post by leeor_net on April 18, 2018, 05:08:47 PM »
Quote
I'm assuming multiple inheritance means something like:

great-grandparent->grandparent->parent->child->grandchild ... etc.

What you described is a single inheritance hierarchy. Each child class only inherits from a single parent class.

In C++, multiple inheritance is when an object inherits from more than one base class. E.g.:


Code: [Select]
class Foo
{
    /* Whatever stuff here */
};

class Bar
{
    /* Whatever stuff here */
};

class FooBar: public Foo, public Bar
{
    /* I inherit from two parents! */
};


Quote
Does C++ allow for Composition, like Python does?

Yes. It's just a fancy way of saying that a class can use other classes as member variables. E.g.:

Code: [Select]
class Contrived
{
    /* useless stuff here */
};

class SomeClass
{
public:
    SomeClass() {}
    ~SomeClass() {}

private:
    int _someInt;
    std::string _someString; /* std::string is a class */
    Contrived _someContrivedObject; /* Contrived is a class declared above */
};

The above code is basically useless but it does illustrate composition. Basically, you're composing a class using other classes (and also non-classes if you want to be very broad about the definition).

A good way to think about it is like this: Inheritance means Class B is a Class A vs. composition in which Class B has a Class A.
18
Computers & Programming General / Re: Learning C through a fun project?
« Last post by Vagabond on April 18, 2018, 01:41:16 PM »
I bought the book Programming in C, 4th edition by Stephen G. Kochan https://www.amazon.com/Programming-C-4th-Developers-Library/dp/0321776410/

The book assumes no prior programming knowledge. The first chapter was pretty informative as an overview of how C came about and how a program compiles. Interestingly enough, Visual Studio 2017 doesn't fully support C11 and a lot of people will not use VS2017 when programming in C, I think due to it being a bit of a second class language on Visual Studio.

I've been picking up interesting tidbits like a c function assumes an int return if no return is specified in the prototype. Also, I didn't realize you could declare a variable that exists inside a function as static. Actually, I don't know if declaring a variable in a function as static is a C only thing or if it applies to C++. There is a keyword called auto that explicity states a function variable is not static as well.

He uses lots of mathematic examples like calculating all the prime numbers, calculating Fibonacci numbers, finding the square root, etc. He is easy to read and follow, so it is an enjoyable read so far.



lordpalandus,

multiple inheritance doesn't mean that. What it looks like you are describing is 'single' inheritance as supported by C# (only 1 parent per class). More specifically C++ also supports single inheritance in addition to multiple, but C# does not support multiple inheritance. Multiple inheritance is where one class has more than one parent class.

parent1 parent2
   |       |
   ChildClass

Using multiple inheritance on a regular basis is considered a poor practice as it can make the code base difficult to understand, debug, and continue to practice future inheritance on. The Archive code actually has a class that uses multiple inheritance. I'm sure there are edge cases where it is a good practice, although I've never come across a design on my own where it seemed the correct choice.

I've never heard of composition before. After briefly looking at it online, I think it is foreign to both C# and C++ although it does seem like an interesting idea.

-Brett
19
Outpost 2 Mapper / Re: Outpost 2 mapper auto-tiling ruleset & new tiles
« Last post by leeor_net on April 18, 2018, 09:49:56 AM »
I added a new WELL with 15 new tiles to a map. There was an artifact at the bottom of each tile in the Mapper. Then when I loaded the map in Outpost 2, the tiles loaded as mostly whitespace with a little vertical strip of color. I was exporting the WELL from Gimp, so I'm guessing I need to fiddle with the settings some more on export to an 8bpp palettized index bmp.

Think you already nailed it. Probably a format issue.


Leeor,

OP2Utility contains a family of StreamReaders that is integrated with a class called MapData and the Archive code. MapData is basically your MapFile but does not contain any draw code. We would have to implement TileGroup and TileSetManager in OP2Utility and then I guess you would be off to the races. Is this something you want to try in the near future?

In fact it is something I'd like to try. The editor I started working on is better fleshed out as an interface with a lot of potential features in the code base already -- the part I had some trouble with was loading and saving. I'd love to integrate the new code you and Hooman came up with, get something more standardized across all of these projects as they're all sort of inter-related.



Anyway, back to the topic at hand. If you think adding just the 15 tiles will make this doable, I say do it. We can then come up with the auto-terrain function and get OP2-Landlord as our new replacement editor (or another one if everybody would prefer that).
20
Outpost 2 Mapper / Re: Outpost 2 mapper auto-tiling ruleset & new tiles
« Last post by Vagabond on April 17, 2018, 11:39:59 PM »
Below is a link to BlackBox attempting to solve the autotiling of transitions back in 2006. The problem has remained unsolved for 12 years. I am still wanting to explore just adding ~15 tiles to the game and solving it that way with an easier and more standardized algorithm. Anyways, the post is probably worth reading.

https://forum.outpost2.net/index.php/topic,3153.0.html

That post mentions a map may contain up to a maximum of 512 tile sets and 2048 tiles. When I pull up a current map with all WELLs loaded, it contains 2011 tiles. So we should have 37 tiles to work with.

I added a new WELL with 15 new tiles to a map. There was an artifact at the bottom of each tile in the Mapper. Then when I loaded the map in Outpost 2, the tiles loaded as mostly whitespace with a little vertical strip of color. I was exporting the WELL from Gimp, so I'm guessing I need to fiddle with the settings some more on export to an 8bpp palettized index bmp.

Leeor,

OP2Utility contains a family of StreamReaders that is integrated with a class called MapData and the Archive code. MapData is basically your MapFile but does not contain any draw code. We would have to implement TileGroup and TileSetManager in OP2Utility and then I guess you would be off to the races. Is this something you want to try in the near future?

-Brett
Pages: 1 [2] 3 4 ... 10