Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
Graphics Update / Re: Science Structures
« Last post by leeor_net on October 15, 2018, 04:18:38 PM »
The single-dome structure could be re-purposed as an observatory for the surface. Some sort of a requirement for some branch of astronomy?
22
Quote
As for the algorithm complexity, if you were being pedantic, any algorithm is constant time when you fix the input size. As the pop count instruction works on a fixed number of bits (the register size), it is of course constant time. Though you may notice from the algorithm, the actual number of instructions depends on the number of bits involved in the counting. Looks to be logarithmic in the number of bits, which is pretty efficient. And of course, having a machine opcode to do it is always handy. Looks like it can be done quite efficiently at the hardware level.
Not exactly, actually. Whether you're dealing with 8, 16, 32, or 64 bits, (whatever the native bit depth of the system is) the algorithm is almost identical, the only differences being the 0x5555/0x3333/etc. constants would be truncated to whatever bit depth you're interested in, and the last bit shift in the algorithm is ">> (bitDepth - 8 )".

Quote
I tried your suggestion to pass a constexpr through a non-constexpr function. It seems the g++ optimizer is too good. I was not able to fool it with my simple test:
Yeah, sometimes the compiler is able to optimize it away, but it's not totally reliable, and YMMV depending on the compiler. Math operations are probably the best case for this though, whereas more special-case things like memcpy/memset inlining when using a constexpr size tends to not work properly with multiple degrees of inlining.
23
Graphics Update / Re: Health & Welfare
« Last post by Hooman on October 15, 2018, 04:09:17 AM »
All so good, it's hard to choose. I kind of liked A the best, ... but maybe that's saying something about me, and being a stickler for rules.  :-\  Ehh, I'm going to go have a shower.
24
Graphics Update / Re: Science Structures
« Last post by Hooman on October 15, 2018, 03:59:06 AM »
I rather like 01A. The single dome 02A is also pretty cool looking, though yes, considerably more plain, and a bit like an arena.

For some reason the blue doesn't look quite as nice to me. It seems a bit jarring. No idea why though.
25
Ahh, that makes sense. Frontload the work. I was stuck thinking of a single divide rather than an array divide.

Thanks for the pop count link, that was good review. The bit manipulations has a rather interesting structure.

As for the algorithm complexity, if you were being pedantic, any algorithm is constant time when you fix the input size. As the pop count instruction works on a fixed number of bits (the register size), it is of course constant time. Though you may notice from the algorithm, the actual number of instructions depends on the number of bits involved in the counting. Looks to be logarithmic in the number of bits, which is pretty efficient. And of course, having a machine opcode to do it is always handy. Looks like it can be done quite efficiently at the hardware level.



I do rather enjoy the conversion (A % B) => (A & (B - 1)) when B is a power of 2. I use a slight variant of that for rounding up to the next multiple of a power of 2: roundUp(value, multiple) = (value + (multiple - 1)) & ~(multiple - 1)



I tried your suggestion to pass a constexpr through a non-constexpr function. It seems the g++ optimizer is too good. I was not able to fool it with my simple test:

Code: cpp [Select]

unsigned int addOne(unsigned int x) {
  return x + 1;
}

unsigned int divideByTwo(unsigned int x) {
  return x / addOne(1);
}


The result of g++ -c -S -masm=intel -O2 constExprArg.cpp is:
Code: asm [Select]

_Z6addOnej:
.LFB0:
.cfi_startproc
lea eax, 1[rdi]
ret
.cfi_endproc

...

_Z11divideByTwoj:
.LFB1:
.cfi_startproc
mov eax, edi
shr eax         ; Shift right (logical): Divide by 2
ret
.cfi_endproc

26
Graphics Update / Re: Production & Commercial
« Last post by White Claw on October 14, 2018, 08:56:09 PM »
In one of the pictures Leeor posted, I noticed the commercial building looked out of scale compared to everything else. After some discussion with Leeor, here are some adjustments. (Along with the previous for comparison.)
27
Graphics Update / Re: Production & Commercial
« Last post by leeor_net on October 14, 2018, 08:13:26 PM »
The so-called button things are present on the original structures from OUTPOST. They make sense in a couple of senses -- they help to provide additional detail so things aren't so mundane and structurally I could see these as similar to building 'tie rods' for lack of a better term (I'm not an architect...  :-[ ).

Like in the attached image, you have the center point where all of the structural struts come together. The 'button' acts as a sort of 'cap' to provide a pleasant aesthetic finish and could even house some sort of machine room type of deal (though in this case probably something like regulatory computers).

Basically, it works for me. :)
28
Graphics Update / Re: Production & Commercial
« Last post by White Claw on October 14, 2018, 08:12:10 PM »
Okay...Here's the UG factory without any color adjustment, and more white-ish windows. I've also included what I would consider the "existing" yellow windows (with unsaturated colors). If that makes any sense...
29
Graphics Update / Re: Production & Commercial
« Last post by White Claw on October 14, 2018, 07:58:37 PM »
I've really got to get rid of my desire to see clean-sheet designs.

I'm not creative enough to make this many buildings from a clean-sheet design. If someone's able to offer up some concept art, I'm all ears (or eyes, or whatever...).


Quote
One question, why do nearly all of the UG structures have the "button" on top of the cylindrical components?

The only two buildings that have this sort of button are the commercial and factory. Many have some sort of shape at the top of the dome, so maybe that's what you mean? Many of the underground buildings are rounded or domes, which tend to look fairly plain if they don't have something on the top center (such as the science lab, which has a fairly blank center on the dome).


Quote
And no offense, but it kind of looks like it has weeds growing on top of it.

No offence taken, but I'm not entirely sure what you mean...?
30
Graphics Update / Re: Science Structures
« Last post by White Claw on October 14, 2018, 07:53:04 PM »
Incidentally (in the picture above), the nursery, science lab, and park have modified (saturated) colors. While the medical center, university, vertical tube, and commercial building are not color modified.
Pages: 1 2 [3] 4 5 ... 10