Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Thief^

Pages: 1 ... 25 26 [27] 28 29 ... 113
391
General Discussion / Re: if self.isCoder(): post() #Programming Thread
« on: January 21, 2015, 04:07:18 pm »
Or "for (int i = 0; i < height ; i++)" (without the "- 1"). Like I said.

392
General Discussion / Re: if self.isCoder(): post() #Programming Thread
« on: January 21, 2015, 04:03:48 pm »
Did you miss the "- 1" in his code?

393
General Discussion / Re: if self.isCoder(): post() #Programming Thread
« on: January 21, 2015, 03:33:18 pm »
Later languages like C# have been designed so that they can be 2-pass compiled, i.e. it is extremely obvious from the language grammar when a word is a type that just hasn't been encountered before, because there's nothing else it could be. Which means the source can be parsed once looking for types variables and functions etc, and then again to actually compile code. Unfortunately C++ is an ancient language in comparison, and a lot of its problems are issues inherited from C. Needing forward declarations may be fixed with the C++ "modules" proposal being worked on at the moment for a future version of C++ (possibly C++17).

Re: templates:
1: You don't need them:
Code: [Select]
void clear_box(int inputarr[5][5])
{
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 5; i++)
{
inputarr[i][j] = 0;
}
}
}

Works perfectly.

2:
When you wrote this:
Code: [Select]
template <int height, int width>
void copy_array(int from[][height], int to[][width])
you probably meant:
Code: [Select]
template <int height, int width>
void copy_array(int from[height][width], int to[height][width])

3: When you use "<" in a for loop's condition, it excludes its end value.
So when you wrote this:
Code: [Select]
for (int i = 0; i < height - 1; i++)you are looping from 0 to up to and not including 4 (height - 1 == 4). You either mean "< height" or "<= height - 1"

394
General Discussion / Re: if self.isCoder(): post() #Programming Thread
« on: January 21, 2015, 01:09:12 pm »
When you get these two errors together in VC++:
Quote
error C2143: syntax error : missing ';' before '*'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

It means that it doesn't know what the type you've used is, and has tried to use the type as the variable name (in old C "default-int" means if you left the type off it would assume "int" type).

Either move your "struct block" before the variables, or put in a forward declaration:
Code: [Select]
struct block;
C++ likes forward declarations a lot. A forward declaration allows any code that doesn't need to know the internals of the type to compile, so you can declare pointer variables but not instance variables or dereference said pointers, until the actual definition of the type is encountered.

395
DF General Discussion / Re: Size limit
« on: January 21, 2015, 05:29:52 am »
If you divided the size of everything by something (like 10 or 100), could you get bigger creatures?
You'd have to make sure that weights and strengths and densities were proportionally correct, but sure.

396
DF General Discussion / Re: Size limit
« on: January 20, 2015, 07:12:31 am »
64-bit integer calculations on a 32-bit processor come with a significant performance penalty, particularly with multiplication* or division. Add to that the double memory cost, and you only use 64-bit numbers when you have to.

*multiplying 32-bit * 32-bit = 64-bit result is actually an instruction in x86, but 64-bit values actually in the multiply is bad

On a 64-bit processor (or using extensions like SSE that can natively handle 64-bit numbers) this is much less of an issue.

397
Life Advice / Re: Any suggestions for durable laptops?
« on: January 19, 2015, 02:14:22 am »
Dell make some fantastic rugged laptops, but price might be a problem: http://www.dell.com/learn/us/en/19/campaigns/dell-latitude-xfr

You might just be better off insuring it instead.

398
I run DF on my AMD laptop at a playable framerate, at 1 year with a 2x2 embark and no special effort made to optimise it. It's only a very cheap laptop, so it's got a 1.5 GHz AMD E-series chip, so quite frankly I'm amazed.

On the performance end, modern performance Intel chips (i.e. the i7) easily outperform anything by AMD in single-threaded tasks like Dwarf Fortress. I wouldn't expect the same to be true with your quoted Pentium 4 from yonks ago, so I'd think something's broken with your test (or pc).

399
Really you'd need a standard savegame and settings if you want to compare performance across PCs, people posting framerates from different saves really won't help.

400
Life Advice / Re: Solving connection issues
« on: January 16, 2015, 06:30:00 am »
Tracert seems to tell me that the 10th path it used to get to the server has a timeout (that's what the korean says, btw--request has timed out). Is it possible to figure out which path this is then blacklist it somehow? :/
That's not quite what it's saying. If *every* ping to that hop times out, it tends to mean that it's configured not to respond to ping.

Given that the random timeouts happen after that hop, that does suggest that the problem is with one side of that hop (incoming from hop 9 or outgoing to hop 11) or even with one of those routers (hop 9, 10 or 11) itself. Unfortunately you can't find out whose it is, but it might be possible to ID hop 9 to give you a hint. Hop 11 is an international line (run by GTT), which is why the latency skyrockets.

FAKEEDIT: Hop 9 is most likely Korea Telecom. 8 is for sure, most likely all the 112.174.*.* hops are. So the problem seems to be on the border router between Korea Telecom and GTT.

401
this is the computer I'm using - it's nothing super special, but for me it was a near ideal compromise:

http://www.techradar.com/reviews/pc-mac/laptops-portable-pcs/laptops-and-netbooks/acer-aspire-v7-1161958/review#articleContent
I'm not sure I'd agree with their conclusion of "tows the line between Ultrabook and gaming laptop". Unless they mean "not good enough to be called a gaming laptop". It's just barely more graphically capable than intel's integrated graphics.

ChaimanPoo: The Alienware 13 is a little beast, but you might be able to find that level of performance cheaper elsewhere. The "Alienware" name adds significantly to the price.

402
DF General Discussion / Re: DFFD Hosting Dilemma
« on: January 14, 2015, 06:57:16 am »
$10/month is plenty to host something like that, digitalocean.com offers a $10/month plan with 2 TB of bandwidth. Disk space isn't enough for hosting the entire DFFD, but for a small set of high-bandwidth files something like this is perfect.

403
General Discussion / Re: if self.isCoder(): post() #Programming Thread
« on: January 14, 2015, 02:37:10 am »
Where visual studio really shines isn't the compiler so much as the debugger. Community edition even has their profiling tools built in for finding performance issues! AMD also provide a free profiler called CodeXL, which on AMD hardware can show you real low-level black-magic information like cache misses.

404
Life Advice / Re: The Generic Computer Advice Thread
« on: January 12, 2015, 02:21:30 am »
Yeah Minecraft may not have GPU-destroying realism, but good god does it draw a lot.

Edit: I should test it on my laptop, it's got one of the low-end AMD APUs.

405
Life Advice / Re: The Generic Computer Advice Thread
« on: January 11, 2015, 10:48:05 am »
$400 is awfully little for a "gaming" laptop. nVidia do do mobile GPUs, but nothing in that price range. It may be worth looking at AMD laptops, as their integrated GPU is still far better than Intel's (which many things won't run on at all).

That said, out of the ones you've posted links for the 2nd easily has the most powerful CPU.

Pages: 1 ... 25 26 [27] 28 29 ... 113