Skip to main content
gamedev.net
🔒 Locked

Spot the error

Started by Raduprv 8 replies 900+ views
Original Post
Raduprv
Raduprv
I spent about 6 hours yesterday because of this problem (3 people totally overlooked this simpe stupid error, one of them being me). Please let me know if and how long it takes you to find the error/discrepancey, and after a few people post I'll give you the rest of the story. (only the stuff inside the use_area tags counts)

"blocker wall 6"
[use_area]
mix_x: 121
min_y: 74
max_x: 130
max_y: 74
teleport_x: 125
teleport_y: 69
teleport_map: 64
map_object_id: 57
inv_object_id: -1
send_sparks: 0
too_far_text: `Get closer.`
use_text: ``
wrong_object_text: `Nothing happens.`
[/use_area]


"blocker wall 6"
[use_area]
mix_x: 119
min_y: 70
max_x: 132
max_y: 70
teleport_x: 126
teleport_y: 74
teleport_map: 64
map_object_id: 57
inv_object_id: -1
send_sparks: 0
too_far_text: `Get closer.`
use_text: ``
wrong_object_text: `Nothing happens.`
[/use_area]
[edit] You don't have to understand what the stuff does in order to spot the problem.
jfclavette
jfclavette
Third and the other line should be min, not mix.

This wouldn't have happened with a 'decent' file format like XML, mister 'C and text files' [wink]
I teleported home one night; With Ron and Sid and Meg; Ron stole Meggie's heart away; And I got Sydney's leg. <> I'm blogging, emo style
etothex
etothex
Quote:
Original post by jfclavette
This wouldn't have happened with a 'decent' file format like XML, mister 'C and text files' [wink]


and, it wouldn't happen either if the parser spat out an "unrecognized parameter" warning message. Simple problem, simple solution.
Raduprv
Raduprv
Quote:
Original post by jfclavette
Third and the other line should be min, not mix.

This wouldn't have happened with a 'decent' file format like XML, mister 'C and text files' [wink]


Wow, that's very enlightening, can you please tell me how would change the tag from [use_area] to help?

etothex: This is how I finally solved it, after looking at a lot of code and using hardware breakpoints for memory writes.
jfclavette
jfclavette
Quote:
Original post by Raduprv
Quote:
Original post by jfclavette
Third and the other line should be min, not mix.

This wouldn't have happened with a 'decent' file format like XML, mister 'C and text files' [wink]


Wow, that's very enlightening, can you please tell me how would change the tag from [use_area] to help?

etothex: This is how I finally solved it, after looking at a lot of code and using hardware breakpoints for memory writes.


Look up Document Type Definitions. While it would have been somewhat harder NOW than adding an else to your parser, remember that you wouldn't even had to write a parser in the first place. Anyway, cheer up.
I teleported home one night; With Ron and Sid and Meg; Ron stole Meggie's heart away; And I got Sydney's leg. <> I'm blogging, emo style
Raduprv
Raduprv
Oh, you mean adding an XML parsing library? That's usually slow, especially when you have like a few K tags. Besides, it's not like the language would make a difference, would it? :D

Yes, it is done at startup only, but you have no idea how frustrating it can be to wait 1 minute for the server to load each time you want to test something.
jfclavette
jfclavette
Quote:
Original post by Raduprv
Oh, you mean adding an XML parsing library? That's usually slow, especially when you have like a few K tags. Besides, it's not like the language would make a difference, would it? :D


Not that much slower really. Let's say 10% slower. While I agree that the langage wouldn't have made a difference in theory, using XML in a purely procedural language would be very ugly (classic OOPization of C).

Quote:
Yes, it is done at startup only, but you have no idea how frustrating it can be to wait 1 minute for the server to load each time you want to test something.


Oh, you can't recompile and resume ? Now THAT's a place where the language/IDE could improve. [smile]
I teleported home one night; With Ron and Sid and Meg; Ron stole Meggie's heart away; And I got Sydney's leg. <> I'm blogging, emo style
Sneftel
Sneftel
Quote:
Original post by Raduprv
Oh, you mean adding an XML parsing library? That's usually slow, especially when you have like a few K tags. Besides, it's not like the language would make a difference, would it? :D

Yes, it is done at startup only, but you have no idea how frustrating it can be to wait 1 minute for the server to load each time you want to test something.
I've found Expat to be of comparable speed to hand-written parsers. Besides, even if it did take a full minute, think how many times you could've started up the server in the five hours and fifty-nine minutes after Expat caught your typo and told you exactly where it was.
Raduprv
Raduprv
I will look at Expat. That format parser was not written by me, but by some other developer that quit. I don't really like that code, it can cause the server to crash if stuff is not formated right, so I am looking for a replacement.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.