Sign in to follow this  
fup

New Tutorial Online: State-Driven Game Agent Design

Recommended Posts

Good article. you should change the title tho (new page isn't that interesting fo a title.).

Also, the generator and origionator info is in the source, and the html is a bit sloppy.

All in all, it was a good article (liked how you explained how state machines work), which hasn't been htmlized well.

From,
Nice coder

Share this post


Link to post
Share on other sites
Glad you liked the article and thanks for the feedback. As you have gathered... an HTML wizard I am not!

What do you mean the "generator and originator info is in the source"? What is that info, and why does it matter that it's present?

In what way is the HTML sloppy? I just rely on Frontpage and never look at the generated HTML.

cheers

Share this post


Link to post
Share on other sites
Quote:
Original post by fup
Glad you liked the article and thanks for the feedback. As you have gathered... an HTML wizard I am not!

What do you mean the "generator and originator info is in the source"? What is that info, and why does it matter that it's present?

In what way is the HTML sloppy? I just rely on Frontpage and never look at the generated HTML.

cheers


Don't worry much, few people would notice it, but...

What i was looking at is the way the source looks, and although it is machine-readable, it is like the Obfucated C contest for html. There are redundant tags all over the place.

something like this:

<p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:3.0pt;
margin-left:0in;mso-outline-level:1;text-autospace:none'><span
style='font-size:10.0pt;font-family:Arial;color:#FFFFCC'>Note: <i
style='mso-bidi-font-style:normal'>the text for this tutorial comprises part of the second chapter of the book </i>

<a href="../../books/toc_pgaibe.html">Programming Game AI by Example</a><i
style='mso-bidi-font-style:normal'>. Its appearance online is a cunningly disguised attempt to
tempt you into purchasing said book. I have no shame. Buy the book, you’ll
enjoy it</i>. </span><span style='font-size:10.0pt;font-family:Wingdings;
mso-ascii-font-family:Arial;mso-hansi-font-family:Arial;mso-bidi-font-family:
Arial;color:#FFFFCC;mso-char-type:symbol;mso-symbol-font-family:Wingdings'><span
style='mso-char-type:symbol;mso-symbol-font-family:Wingdings'>J</span></span><span
style='font-size:10.0pt;font-family:Arial;color:#FFFFCC'> </span></p>






is just mean to look at... its improperly spaced, it hasn't simplified its tagging (the spans could be tuned into font tags, for greater support, and fewer tags!), and the way the engine formatted it is just not nice at all.

This tag

<meta name=ProgId content=FrontPage.Editor.Document>

Is the generator, it is not something good, it does nothing and isn't very useful (other then to advertise that your using frontpage)

I'm not a html wizard, i just know a thing or two (i also like looking at webpages in there sourcecode).

I would remove the <style> tags (what are those? css?) and replace them with font tags. i would also change the paragraph tags, to newline tags (
). this would allow you to only need to use a font tag when your changing fonts. (it makes things much nicer).

Look at this bit:

<p class=code-white>enum StateType{state_RunAway, state_Patrol, state_Attack};</p>
<p class=code-white> </p>
<p class=code-white>void Agent::UpdateState(StateType CurrentState)</p>
<p class=code-white>{</p>

<p class=code-white> switch(CurrentState)</p>
<p class=code-white> {</p>
<p class=code-white> case state_RunAway:</p>
<p class=code-white> </p>
<p class=code-white> EvadeEnemy();</p>

<p class=code-white> </p>
<p class=code-white> if (Safe())</p>
<p class=code-white> {</p>
<p class=code-white>
ChangeState(state_Patrol);</p>
<p class=code-white> }</p>

<p class=code-white> </p>
<p class=code-white> break;</p>
<p class=code-white> </p>
<p class=code-white> case state_Patrol:</p>
<p class=code-white> </p>
<p class=code-white> FollowPatrolPath();</p>

<p class=code-white> </p>
<p class=code-white> if (Threatened())</p>
<p class=code-white> {</p>
<p class=code-white> if (StrongerThanEnemy())</p>
<p class=code-white> {</p>

<p class=code-white>
ChangeState(state_Attack);</p>
<p class=code-white> }</p>
<p class=code-white> else</p>
<p class=code-white> {</p>

<p class=code-white>
ChangeState(state_RunAway);</p>
<p class=code-white> }</p>
<p class=code-white> }</p>
<p class=code-white> </p>
<p class=code-white> break;</p>

<p class=code-white> </p>
<p class=code-white> case state_Attack:</p>
<p class=code-white> </p>
<p class=code-white> if (WeakerThanEnemy())</p>
<p class=code-white> {</p>
<p class=code-white>

ChangeState(state_RunAway);</p>
<p class=code-white> }</p>
<p class=code-white> else</p>
<p class=code-white> {</p>
<p class=code-white> BashEnemyOverHead();</p>

<p class=code-white> }</p>
<p class=code-white> </p>
<p class=code-white> break;</p>
<p class=code-white> </p>
<p class=code-white> }//end switch</p>
<p class=code-white>}</p>





(please note that the spaces would be &nb'sp; in the source. (remove the ')

Look at all the effort (and tags that would have been saved if only the generator was smart enough to do something like:
<p class=code-white>Stuff stuff stuff <lbr>
Stuff stuff stuff <'br>
&nb'sp;&nb'sp;&nb'sp;Stuff
<'/br>
<'/p>

(sorry about the ''s, it won't let me do the tags without them.)
Much easier on the eyes, and on the bandwith.

As i said, nice article, but please make the html more readable! (it could save you a bit on bandwith!)

Also, all of your pages's titles are things like "New page 1" and "New page 2", can you please change them? (because you've got a good website otherwise) To do that, right click on the page, and select "Page properties", you then change the text next to the label which says "Title".

From,
Nice coder

Share this post


Link to post
Share on other sites
thanks for explaining that to me. I don't think I'm going to do anything about it though (apart from the page titles). I have no desire or time to reformat code that the majority of readers will never look at, and which, in the end, will make no difference to their experience.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this