## Search found 291 matches

October 15th, 2009, 10:07 pm
Forum: Ideas
Topic: Possible to make a smarter 'next men'?
Replies: 34
Views: 3550

### Re: Possible to make a smarter 'next men'?

Stateful means the algorithm you just suggested :wink: . It means any algorithm that has to keep track of some value for each unit. As already pointed out, any such algorithm is complicated, because you have to worry about things like units dying, or being screwed with by events. Also, the algorithm...
October 15th, 2009, 9:56 pm
Forum: WML Workshop
Topic: precisions on WML grammar
Replies: 27
Views: 2072

### Re: precisions on WML grammar

Basically, there are two phases of interpretation. In the first, string operations happen. If you've got quotes, then there's nothing to do in this phase (because it recognizes stuff within quotes as one big string already). If you don't, the addition is interpreted as a string operation and perform...
October 15th, 2009, 9:46 pm
Forum: Art Workshop
Topic: Fire/Ice
Replies: 9
Views: 1346

### Re: Fire/Ice

Well... you can always hue/saturation the entire image, if you're going for simplicity. The problem with colorize (which would be equally simple) is that it takes out all of the hue variation, whereas hue/saturation preserves it. Of course, depending on the starting and ending hues, the initial hue ...
October 15th, 2009, 9:38 pm
Forum: WML Workshop
Topic: precisions on WML grammar
Replies: 27
Views: 2072

### Re: precisions on WML grammar

It's 42, isn't it. Because Wesnoth sees \$(2*2+1) and goes: "Oh, there's a +, let me just concatenate these strings, and then I can evaluate this" and then goes "Huh, what was \$(2*21) again? Oh right, 42."

"\$(2*2+1)", on the other hand, should be 5.
October 15th, 2009, 9:22 pm
Forum: Ideas
Topic: Possible to make a smarter 'next men'?
Replies: 34
Views: 3550

### Re: Possible to make a smarter 'next men'?

How about implementing Christofides algorithm ? This should give a reasonable approximation of the traveling salesman. The tour would have to be reevaluated each time a unit move though. (Or rather each time next is pressed after a unit have moved) Um... that looks pretty complicated to implement, ...
October 15th, 2009, 9:06 pm
Forum: Ideas
Topic: Walking corpses changes
Replies: 26
Views: 2771

### Re: Walking corpses changes

@solsword Your solution wouldn't be the simplest since it would require programing, where as changing units stats is very simple by comparison. As Neoskel pointed out, changing the stats (to make drake WC's fly) also involves changing the artwork at some point. Which is vastly more complex than cod...
October 14th, 2009, 1:33 am
Forum: WML Workshop
Topic: precisions on WML grammar
Replies: 27
Views: 2072

### Re: precisions on WML grammar

@silene: wow. I can't imagine how I didn't think about that. Sorry. Just goes to show why you should always listen to a dev on these subjects! @Anonymissimus: templates do make types somewhat less painful (again, just my perspective here), but they're no panacea (and have some of their own ugly issu...
October 13th, 2009, 4:09 pm
Forum: WML Workshop
Topic: precisions on WML grammar
Replies: 27
Views: 2072

### Re: precisions on WML grammar

Although a type system adds some complexity first, I'd like to see WML having one, too. It makes code easier to understand, interpret and stable in the end if you're forced to write const unsigned int GotoX=10; and such. I'm using type specific variable prefixes (i=integer, b=bool,...) but it is on...
October 13th, 2009, 7:49 am
Forum: Coder’s Corner
Topic: WML semantic structure -- parsing
Replies: 24
Views: 5569

### Re: WML semantic structure -- parsing

Yeah... I figured it might not be as simple as what I wrote (heck, I knew it wasn't *that* simple, but I thought it might not be that much more difficult)... In any case, my script has many flaws. Right now, it looks for WML_HANDLER_FUNCTION functions, and then scans their bodies for any use of cfg[...
October 13th, 2009, 7:32 am
Forum: Ideas
Topic: Reverse Games (Mainline Multiplayer Idea)
Replies: 6
Views: 1043

### Re: Reverse Games (Mainline Multiplayer Idea)

This does seem like an awful lot of coding work (read: insane amount), and Soliton's solution would work. However, something which might be easier to implement, but still have many of the same advantages: augment the lobby just a bit so that you can arrange to play the two games back-to-back beforeh...
October 12th, 2009, 8:43 pm
Forum: WML Workshop
Topic: Angry elemental - CREATE UNIT ABILITY that work !
Replies: 9
Views: 3008

### Re: Angry elemental - CREATE UNIT ABILITY that work !

a general comment: People would be more willing (and able) to help you if you were coding entirely in English. There is a built-in translation system for description stuff anyway. I disagree with the sentiment behind this. The built-in translation system doesn't need English text as a base, so it's...
October 12th, 2009, 8:35 pm
Forum: WML Workshop
Topic: CONVERT experience TO gold
Replies: 5
Views: 623

### Re: CONVERT experience TO gold

A possibly more complicated alternate solution: just store every unit on the side at the beginning of each turn, and compute gold gained at the end of the turn. You'd have to be careful about units dying, and you wouldn't be able to display the gold gained in a particular battle (although you could ...
October 12th, 2009, 1:32 am
Forum: Ideas
Topic: Walking corpses changes
Replies: 26
Views: 2771

### Re: Walking corpses changes

Well... how about a compromise? Insert a WML even to kill walking corpses that don't have the right movetype when they're created over a chasm. Then when they get a flying movetype, they won't be killed. I really like the idea of plagued drakes falling into the chasm because they can't fly: it adds ...
October 12th, 2009, 1:14 am
Forum: Coder’s Corner
Topic: WML semantic structure -- parsing
Replies: 24
Views: 5569

### Re: WML semantic structure -- parsing

Well... don't know if this will go anywhere or not, but here's a partial proof-of-concept: #!/usr/bin/env python import re fin = open("/home/pmawhorter/programming/wesnoth/wesnoth-trunk/src/game_events.cpp") data = fin.read() fin.close() doc = '' tag_func_re = re.compile("WML_HANDLER_FUNCTION\(([^\n...
October 11th, 2009, 10:55 pm
Forum: Coder’s Corner
Topic: WML semantic structure -- parsing
Replies: 24
Views: 5569

### Re: WML semantic structure -- parsing

...the problem that I see with such a 'canonical' file is that it requires additional maintenance overhead (i.e. someone has to run your parser every time there's an update, and then new templates have to be made, etc.), and it's still distant from the code (i.e. the people who will be updating it w...