Welcome to GameHourz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

coding questions

 
   Game Forums (Home) -> Roguelike -> Angband RSS
Next:  (Ironband) a question, a bug, and a request  
Author Message
griboax

External


Since: Jan 28, 2008
Posts: 1



(Msg. 1) Posted: Mon Jan 28, 2008 2:18 pm
Post subject: coding questions
Archived from groups: rec>games>roguelike>angband (more info?)

Hi all,

I've been toying with the idea of doing a variant based on Heng/
Entroband. I am a very novice coder and had some questions that I was
wondering if someone could answer.

1) Does it matter which C compiler you use? I'm using Openwattcom, but
noticed it wasn't listed on Thangorodrim.

2) Is there a compiler with an automated search and replace function
that will go through the various source files and delete specified
lines of code? I'm trying to get rid of virtues (always hated them)
and am not looking forward to the task of manually deleting everything
line by line.

3) I know that in Gumband, you get 50% xp from monsters that your pets
kill. Where is this feature documented in the source code?

Thanks for all the help.

 >> Stay informed about: coding questions 
Back to top
Login to vote
Eddie Grove

External


Since: Oct 17, 2007
Posts: 80



(Msg. 2) Posted: Mon Jan 28, 2008 2:50 pm
Post subject: Re: coding questions [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

griboax RemoveThis @gmail.com writes:

> Hi all,
>
> I've been toying with the idea of doing a variant based on Heng/
> Entroband. I am a very novice coder and had some questions that I was
> wondering if someone could answer.
>
> 1) Does it matter which C compiler you use? I'm using Openwattcom, but
> noticed it wasn't listed on Thangorodrim.

That seems unlikely to matter.

> 2) Is there a compiler with an automated search and replace function
> that will go through the various source files and delete specified
> lines of code? I'm trying to get rid of virtues (always hated them)
> and am not looking forward to the task of manually deleting everything
> line by line.

That is not a compiler function. You may want to learn a scripting language.
Perl used to be the rage. Now Python is in vogue.

Unfortunately it may not be as simple as simply removing any line containing
the word "virtue". For example, you may have a block

if (!virtue)
{
do some stuff;
}
else
{
do some other stuff;
}

You might be able to handle deleting that sort of thing with a perl script,
but I would be afraid of introducing strange errors.

>
> 3) I know that in Gumband, you get 50% xp from monsters that your pets
> kill. Where is this feature documented in the source code?

I know nothing of Gumband, but using the command

grep "p_ptr->exp" src/*c

only returns about 50 matches on Vanilla. You could do that sort of thing and
scan for things that look like they might be relevant. You will need to
figure out how to go about searching the source one way or another.


Eddie

 >> Stay informed about: coding questions 
Back to top
Login to vote
pete m

External


Since: Nov 15, 2007
Posts: 45



(Msg. 3) Posted: Mon Jan 28, 2008 9:31 pm
Post subject: Re: coding questions [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Jan 28, 2:18 pm, grib....TakeThisOut@gmail.com wrote:
> Hi all,
>
> I've been toying with the idea of doing a variant based on Heng/
> Entroband. I am a very novice coder and had some questions that I was
> wondering if someone could answer.
>
> 1) Does it matter which C compiler you use? I'm using Openwattcom, but
> noticed it wasn't listed on Thangorodrim.
>
> 2) Is there a compiler with an automated search and replace function
> that will go through the various source files and delete specified
> lines of code? I'm trying to get rid of virtues (always hated them)
> and am not looking forward to the task of manually deleting everything
> line by line.

I second Paul's comment that you should install the free version of
Visual Studio. It's missing only enterprise-level stuff like .NET,
RPC support, and the modern infrastructure for creating UIs.

Living without a good debugger is a MAJOR chore for a novice
programmer, or an experienced programmer for that matter.
 >> Stay informed about: coding questions 
Back to top
Login to vote
Paul Murray

External


Since: Jan 18, 2005
Posts: 112



(Msg. 4) Posted: Mon Jan 28, 2008 10:39 pm
Post subject: Re: coding questions [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2008-01-28, griboax.DeleteThis@gmail.com <griboax.DeleteThis@gmail.com> wrote:
> 1) Does it matter which C compiler you use? I'm using Openwattcom, but
> noticed it wasn't listed on Thangorodrim.

If you are using Windows there really isn't any reason not to use the free
version of Visual Studio. If you want a more cross-platform approach, you
can install cygwin and use gcc, as you would on linux or other platforms.
 >> Stay informed about: coding questions 
Back to top
Login to vote
konijn_

External


Since: Nov 15, 2007
Posts: 51



(Msg. 5) Posted: Tue Jan 29, 2008 3:34 am
Post subject: Re: coding questions [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2008-01-28 23:18:09, griboax DeleteThis @gmail.com wrote:

> Hi all,
>
> I've been toying with the idea of doing a variant based on Heng/
> Entroband. I am a very novice coder and had some questions that I was
> wondering if someone could answer.

Hmm, the authors of Heng and Entro are no longer around. Maybe you could
consider building a variant based on Hellband Wink I dont know how much of the
monster list of Entro would work just like that, and you would miss some
classes/races of course.

>
> 1) Does it matter which C compiler you use? I'm using Openwattcom, but
> noticed it wasn't listed on Thangorodrim.

Eh. It should not. I am fairly certain you could find a watcomm compiler
makefile for Vanilla that you could retrofit to your variant.

> 2) Is there a compiler with an automated search and replace function
> that will go through the various source files and delete specified
> lines of code? I'm trying to get rid of virtues (always hated them)
> and am not looking forward to the task of manually deleting everything
> line by line.

That would be an Editor function really, and I am afraid that if you dont do it
manually you will generate bugs that will take lots of time to find and fix.
> 3) I know that in Gumband, you get 50% xp from monsters that your pets
> kill. Where is this feature documented in the source code?

Dont know.

>
> Thanks for all the help.
>
>


--
* Go to Hell (http://hellband.googlepages.com/index.html), now version 0.8.6! *
 >> Stay informed about: coding questions 
Back to top
Login to vote
Kenneth 'Bessarion' Boyd

External


Since: Oct 18, 2007
Posts: 161



(Msg. 6) Posted: Tue Jan 29, 2008 6:00 am
Post subject: Re: coding questions [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2008-01-29 06:31:57, pete m <pmac360.RemoveThis@yahoo.com> wrote:

> On Jan 28, 2:18 pm, grib....RemoveThis@gmail.com wrote:
> > Hi all,
> >
> > I've been toying with the idea of doing a variant based on Heng/
> > Entroband. I am a very novice coder and had some questions that I was
> > wondering if someone could answer.
> >
> > 1) Does it matter which C compiler you use? I'm using Openwattcom, but
> > noticed it wasn't listed on Thangorodrim.

OpenWatcom is fine. What's important is that the C compiler be actively
maintained.

If you go with any traditional command-line suite, you will need both a
programming editor and familiarity with your compiler's make utility.

An IDE (such as Visual Studio) is a high-end programming editor, that
coordinates using the make utility for you.

> > 2) Is there a compiler with an automated search and replace function
> > that will go through the various source files and delete specified
> > lines of code? I'm trying to get rid of virtues (always hated them)
> > and am not looking forward to the task of manually deleting everything
> > line by line.

Get used to any good programming editor's integrated find function.

> I second Paul's comment that you should install the free version of
> Visual Studio. It's missing only enterprise-level stuff like .NET,
> RPC support, and the modern infrastructure for creating UIs.

The learning curve will be less, yes.

> Living without a good debugger is a MAJOR chore for a novice
> programmer, or an experienced programmer for that matter.

With the sole exception of mathematicians Wink

I've never paid the time to learn to use a debugger because tracing them in
source is relatively easy compared to formal proof-writing. It might be a case
of "the good is the enemy of the best", but there's no way I could justify
spending the time to be only incompetent with using a debugger (rather than
practically clueless like I am now).
 >> Stay informed about: coding questions 
Back to top
Login to vote
pete m

External


Since: Nov 15, 2007
Posts: 45



(Msg. 7) Posted: Tue Jan 29, 2008 7:01 am
Post subject: Re: coding questions [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Jan 28, 10:00 pm, Kenneth 'Bessarion' Boyd <zaim....TakeThisOut@zaimoni.com>
wrote:
> On 2008-01-29 06:31:57, pete m <pmac....TakeThisOut@yahoo.com> wrote:
>
> > On Jan 28, 2:18 pm, grib....TakeThisOut@gmail.com wrote:
> > > Hi all,
>
> > > I've been toying with the idea of doing a variant based on Heng/
> > > Entroband. I am a very novice coder and had some questions that I was
> > > wondering if someone could answer.
>
> > > 1) Does it matter which C compiler you use? I'm using Openwattcom, but
> > > noticed it wasn't listed on Thangorodrim.
>
> OpenWatcom is fine. What's important is that the C compiler be actively
> maintained.
>
> If you go with any traditional command-line suite, you will need both a
> programming editor and familiarity with your compiler's make utility.
>
> An IDE (such as Visual Studio) is a high-end programming editor, that
> coordinates using the make utility for you.
>
> > > 2) Is there a compiler with an automated search and replace function
> > > that will go through the various source files and delete specified
> > > lines of code? I'm trying to get rid of virtues (always hated them)
> > > and am not looking forward to the task of manually deleting everything
> > > line by line.
>
> Get used to any good programming editor's integrated find function.
>
> > I second Paul's comment that you should install the free version of
> > Visual Studio. It's missing only enterprise-level stuff like .NET,
> > RPC support, and the modern infrastructure for creating UIs.
>
> The learning curve will be less, yes.
>
> > Living without a good debugger is a MAJOR chore for a novice
> > programmer, or an experienced programmer for that matter.
>
> With the sole exception of mathematicians Wink
>
> I've never paid the time to learn to use a debugger because tracing them in
> source is relatively easy compared to formal proof-writing.

That's fine, so long as you have an idea of where the bug is. Even if
you don't watch the program (I rarely do), it's useful to know exactly
where the thing failed, and what variables had bad values. Of course
you can do this with printf() and assert(), but it's usually faster
to just pop it in the debugger.


> It might be a case
> of "the good is the enemy of the best", but there's no way I could justify
> spending the time to be only incompetent with using a debugger (rather than
> practically clueless like I am now).
 >> Stay informed about: coding questions 
Back to top
Login to vote
pete m

External


Since: Nov 15, 2007
Posts: 45



(Msg. 8) Posted: Tue Jan 29, 2008 12:12 pm
Post subject: Re: coding questions [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Jan 29, 9:20 am, Paul J Gans <g....DeleteThis@panix.com> wrote:
> Paul Murray <p....DeleteThis@murray.net> wrote:
> >On 2008-01-28, grib....DeleteThis@gmail.com <grib....DeleteThis@gmail.com> wrote:
> >> 1) Does it matter which C compiler you use? I'm using Openwattcom, but
> >> noticed it wasn't listed on Thangorodrim.
> >If you are using Windows there really isn't any reason not to use the free
> >version of Visual Studio. If you want a more cross-platform approach, you
> >can install cygwin and use gcc, as you would on linux or other platforms.
>
> Is gcc available for current Macs?
>
> If so that might be the way to go for later porting ease.
>

gcc comes preinstalled on mac, and it is the compiler used at Apple.
 >> Stay informed about: coding questions 
Back to top
Login to vote
Paul J Gans

External


Since: Jan 17, 2005
Posts: 48



(Msg. 9) Posted: Tue Jan 29, 2008 5:20 pm
Post subject: Re: coding questions [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Paul Murray <paul.TakeThisOut@murray.net> wrote:
>On 2008-01-28, griboax.TakeThisOut@gmail.com <griboax.TakeThisOut@gmail.com> wrote:
>> 1) Does it matter which C compiler you use? I'm using Openwattcom, but
>> noticed it wasn't listed on Thangorodrim.

>If you are using Windows there really isn't any reason not to use the free
>version of Visual Studio. If you want a more cross-platform approach, you
>can install cygwin and use gcc, as you would on linux or other platforms.

Is gcc available for current Macs?

If so that might be the way to go for later porting ease.

--
--- Paul J. Gans
 >> Stay informed about: coding questions 
Back to top
Login to vote
The Wanderer

External


Since: Dec 20, 2004
Posts: 147



(Msg. 10) Posted: Tue Jan 29, 2008 6:02 pm
Post subject: Re: coding questions [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Kevin Williams wrote:

> The Underpants Gnomes tell me that pete m <pmac360 RemoveThis @yahoo.com> wrote:
>> On Jan 29, 9:20 am, Paul J Gans <g... RemoveThis @panix.com> wrote:
>>> Is gcc available for current Macs?
>>>
>>> If so that might be the way to go for later porting ease.
>>>
>> gcc comes preinstalled on mac, and it is the compiler used at
>> Apple.
>
> Not entirely true. You have to install the developer tools, Xcode,
> first.

From what I understand from my time on the MPlayer development lists,
however, Apple's gcc is not necessarily the same as what you'll get from
the "official" GCC project; I don't remember any details, but I believe
there have been some issues about getting some of their code to compile
correctly in both.

(Then again, MPlayer contains some fairly low-level code, and no small
bit of hand-written ASM. I wouldn't be surprised if an *band would have
no problems with any differences there might be.)

--
The Wanderer

My usual .sig is on vacation while I adjust to my new computer
 >> Stay informed about: coding questions 
Back to top
Login to vote
Kevin Williams

External


Since: Jul 18, 2005
Posts: 2



(Msg. 11) Posted: Tue Jan 29, 2008 8:34 pm
Post subject: Re: coding questions [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

The Underpants Gnomes tell me that
pete m <pmac360.DeleteThis@yahoo.com> wrote:
> On Jan 29, 9:20 am, Paul J Gans <g....DeleteThis@panix.com> wrote:
>> Is gcc available for current Macs?
>>
>> If so that might be the way to go for later porting ease.
>>
> gcc comes preinstalled on mac, and it is the compiler used at Apple.

Not entirely true. You have to install the developer tools, Xcode,
first.
--
Kevin
 >> Stay informed about: coding questions 
Back to top
Login to vote
Nick

External


Since: Apr 14, 2005
Posts: 92



(Msg. 12) Posted: Tue Jan 29, 2008 8:41 pm
Post subject: Re: coding questions [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2008-01-29 16:01:00, pete m <pmac360.RemoveThis@yahoo.com> wrote:

> On Jan 28, 10:00 pm, Kenneth 'Bessarion' Boyd
> wrote:

> > With the sole exception of mathematicians Wink
> >
> > I've never paid the time to learn to use a debugger because tracing them in
> > source is relatively easy compared to formal proof-writing.

And here I was thinking that the reason I had such trouble with the programming
technicalities was because I was just a mathematician unlike, say, you. Thanks
for clearing that up Sad

> That's fine, so long as you have an idea of where the bug is. Even if
> you don't watch the program (I rarely do), it's useful to know exactly
> where the thing failed, and what variables had bad values. Of course
> you can do this with printf() and assert(), but it's usually faster
> to just pop it in the debugger.

This is my experience exactly. It also allows me to fix corrupted savefiles in
some cases.

Nick.
--
"You are judging by social rules, and finding crime. I am considering an
elemental struggle, and finding no crime, just grim, primeval danger." - The
Midwich Cuckoos, John Wyndham
 >> Stay informed about: coding questions 
Back to top
Login to vote
Paul J Gans

External


Since: Jan 17, 2005
Posts: 48



(Msg. 13) Posted: Wed Jan 30, 2008 1:50 am
Post subject: Re: coding questions [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

pete m <pmac360 RemoveThis @yahoo.com> wrote:
>On Jan 29, 9:20 am, Paul J Gans <g... RemoveThis @panix.com> wrote:
>> Paul Murray <p... RemoveThis @murray.net> wrote:
>> >On 2008-01-28, grib... RemoveThis @gmail.com <grib... RemoveThis @gmail.com> wrote:
>> >> 1) Does it matter which C compiler you use? I'm using Openwattcom, but
>> >> noticed it wasn't listed on Thangorodrim.
>> >If you are using Windows there really isn't any reason not to use the free
>> >version of Visual Studio. If you want a more cross-platform approach, you
>> >can install cygwin and use gcc, as you would on linux or other platforms.
>>
>> Is gcc available for current Macs?
>>
>> If so that might be the way to go for later porting ease.
>>

>gcc comes preinstalled on mac, and it is the compiler used at Apple.

Thanks. I wasn't sure if it was preinstalled.

--
--- Paul J. Gans
 >> Stay informed about: coding questions 
Back to top
Login to vote
Paul J Gans

External


Since: Jan 17, 2005
Posts: 48



(Msg. 14) Posted: Wed Jan 30, 2008 1:51 am
Post subject: Re: coding questions [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Kevin Williams <me.RemoveThis@privacy.net> wrote:
>The Underpants Gnomes tell me that
> pete m <pmac360.RemoveThis@yahoo.com> wrote:
>> On Jan 29, 9:20 am, Paul J Gans <g....RemoveThis@panix.com> wrote:
>>> Is gcc available for current Macs?
>>>
>>> If so that might be the way to go for later porting ease.
>>>
>> gcc comes preinstalled on mac, and it is the compiler used at Apple.

> Not entirely true. You have to install the developer tools, Xcode,
>first.

Ok, but still, a version coded in gcc compatible code would seem
to have a big advantage for portage to the Mac as well as Win/Linux.

--
--- Paul J. Gans
 >> Stay informed about: coding questions 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
{Coding} {S} tval_to_attr - So, color me confused. Somewhere along the line, between Sangband099beta20d and Sang099alpha21, the tvals for bows/slings/crossbows have been changed (which I knew), but this messed up the tval_to_attr table, making them show up as white in inventory,...

[OS X only] Questions about main-crb.c - As an exercise in finally learning to program my computer as more than a generic unix box, I am *attempting* to migrate main-crb.c to Quartz/Carbon. There is good reason to do so. Quote from Quickdraw Reference: "Important: Quickdraw has been..

[Un] beginner's questions - What should I do with Farmer Maggot? Can't fight him, can't talk to him, yet the descriptions blurb says "he impedes your progress". What's up with all those fountains and statues? Just a flavour? When I learn a prayer, a one-slot "Bead&...

[Un] Frequently asked questions - Hi, The Unangband FAQ is included in the 0.6.0-beta 2 release. I reproduce it here: === Frequently Asked Questions === Most of these questions have been taken from the newsgroup rec.games.roguelike.angband. If something isn't answered here feel free t...

Steamband newbie questions - I have been playing Steamband a bit recently and have a few questions for the collective mind. So far it is a really fun game! I enjoy the flavor change a lot, it provides a refreshing shift from Vanilla every now and then. I haven't yet made it far..
   Game Forums (Home) -> Roguelike -> Angband All times are: Ekaterinburg, Islamabad, Karachi, Tashkent (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]