Jump to content


Photo

Programmer


  • Please log in to reply
45 replies to this topic

#26 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 11921 posts

Posted 30 July 2017 - 07:35 AM

To me, it looks better once changed as it matches the download list, however, I guess this is all personal preference - are bugs reviewed once people submit them?

 

Please could I have permissions added for the repo if you want me to commit this fix/preference?

 

When new coders volunteer, they post their changes for review via a patch file. We look through the patch file and see if it looks okay, then apply the patch for them.

 

After they have a few bug fixes under their belt, and it looks like they're getting the hang of it, w/o needing a lot of fixes to their patches, then we'll open the door and let them have write access to the source repo.

 

So hang in there, fix a few problems, and we'll see about getting you write access.

 

For future reference, I prefer that you mark your code changes so they can be tied to specific problems that you're fixing. For example, search for "grayman" in the source to see how I've done it for my changes. I find this invaluable if we later have a problem in a bit of code and need to talk to the person who made the change. (Also, in my case, it makes it easier for me to find all the scattered bits of changes I made a few years back to fix a particular problem.)


  • AluminumHaste likes this

#27 AlexDiru

AlexDiru

    Member

  • Member
  • PipPip
  • 30 posts

Posted 30 July 2017 - 07:44 AM

Ok that sounds good.

 

But just to be awkward - what about when I remove code? Do the keep the removed code commented out, or just note I've removed code? This would be for the mission list name organisation.

 

How do patch files work, is there a wiki guide, or is it as simple as uploading any changed code files?



#28 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 11921 posts

Posted 30 July 2017 - 08:05 AM

"Second point, you are correct, I can't see a fix for the general case without a fundamental change of the behaviour of the reading of the files - I think it would be better just to hardcode the fixes, since they are in-built items and people can still control custom items.The hardcode fix will be something like:"

CanDrop?() {
   If Name In { "Compass", "Lockpick", "Blackjack", ... }
      Return False
   Behave As Normal From Here On
}

I wouldn't take that route. I'd look at the Shop code and try to understand the origin of the un-droppable state.

 

For example, CShop::AddItems() handles the reading of the shop entity, and checks droppability using this line:

 

bool canDrop = mapDict.GetBool(itemPrefix + "_canDrop", "1"); // items can be dropped by default
 
 
 
To me, that looks like a disparity between what items that aren't handled by the shop entity default to ("0") and what items that are handled by the shop entity default to ("1").
 
But that might not be something that can be reconciled after 10 years, given the danger of making a change and unknowingly wrecking an existing map.
 
--------------------------------------------------
 
The droppability bug in the shop should deal with "when an item says it's not droppable (whether via the shop item or via a def file), why do we give it a Drop/Take button?". Once you take the button away, the "but the item I dropped in the shop is still in my inventory at map start" complaint goes away.
 
 

 



#29 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 11921 posts

Posted 30 July 2017 - 08:10 AM

But just to be awkward - what about when I remove code? Do the keep the removed code commented out, or just note I've removed code? This would be for the mission list name organisation.

 

How do patch files work, is there a wiki guide, or is it as simple as uploading any changed code files?

 

I comment out code that's no longer used. That way, someone following later can see what used to be there. Sometimes we find--months later--that removing a bit of code caused an unforeseen problem, and it's easier to just remove the comment marks than it is to compare SVN revision differences and try to reconstruct "the old way".

 

After a few releases, and especially if the surrounding code starts to become a bit unreadable, we can remove old dead commented code, just to clean things up.

 

You need to read SVN documentation to understand how to create and install a patch. For example, if you're using TortoiseSVN, you'll find that here.



#30 AlexDiru

AlexDiru

    Member

  • Member
  • PipPip
  • 30 posts

Posted 30 July 2017 - 08:13 AM

 

For example, CShop::AddItems() handles the reading of the shop entity, and checks droppability using this line:

 

bool canDrop = mapDict.GetBool(itemPrefix + "_canDrop", "1"); // items can be dropped by default
 
To me, that looks like a disparity between what items that aren't handled by the shop entity default to ("0") and what items that are handled by the shop entity default to ("1").
 
But that might not be something that can be reconciled after 10 years, given the danger of making a change and unknowingly wrecking an existing map.
 

 

I agree with that, I think there's a very high risk of breaking stuff for this minor change

 

 

 

The droppability bug in the shop should deal with "when an item says it's not droppable (whether via the shop item or via a def file), why do we give it a Drop/Take button?". Once you take the button away, the "but the item I dropped in the shop is still in my inventory at map start" complaint goes away.
 

 

 

Yep, the key is that it is not looking at the def file, only items in the map file. If the code was changed significantly to look at attributes in both the def and map files, I have a feeling it's going to break a lot of FMs - and this will be hard to test for.

 

Cheers for the SVN link, I'll give it a read :)



#31 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 11921 posts

Posted 30 July 2017 - 08:23 AM

 

Yep, the key is that it is not looking at the def file, only items in the map file. If the code was changed significantly to look at attributes in both the def and map files, I have a feeling it's going to break a lot of FMs - and this will be hard to test for.

 

 

Ah, but the way things work at spawn time is that the def file is read and the spawnargs are put into a dictionary using key/value pairs.

 

Then the spawnargs defined in the map file are added to the item's dictionary. If an item redefines a key/value pair, it gets changed.

 

When the shop is built, it looks at the dictionary's key/value pairs, and shouldn't care whether a pair originated in a def file or a map file.

 

Something weird is going on there, and it needs to be uncovered and fixed.



#32 Goldwell

Goldwell

    Team Member

  • Active Developer
  • PipPipPipPip
  • 2164 posts

Posted 30 July 2017 - 08:38 AM

I know i'm late to the game (or maybe this thread is moving fast) but I just wanted to say welcome Alex and thanks for putting forward your talents toward bettering the mod :)


  • AluminumHaste and HMart like this

The Accountant Series
Part 1 (coming soon) | Part 2: New In town


Lord Edgar Trilogy
Lord Edgar's Bathhouse
 
Stand Alone Missions
Spring Cleaning


#33 AlexDiru

AlexDiru

    Member

  • Member
  • PipPip
  • 30 posts

Posted 30 July 2017 - 08:49 AM

 

Ah, but the way things work at spawn time is that the def file is read and the spawnargs are put into a dictionary using key/value pairs.

 

Then the spawnargs defined in the map file are added to the item's dictionary. If an item redefines a key/value pair, it gets changed.

 

When the shop is built, it looks at the dictionary's key/value pairs, and shouldn't care whether a pair originated in a def file or a map file.

 

Something weird is going on there, and it needs to be uncovered and fixed.

 

So at the shop spawn the dictionary should contain pairs from both the def file and the map file (if the item is in both?)

 

 

I know i'm late to the game (or maybe this thread is moving fast) but I just wanted to say welcome Alex and thanks for putting forward your talents toward bettering the mod :)

 

Thank you :)



#34 AlexDiru

AlexDiru

    Member

  • Member
  • PipPip
  • 30 posts

Posted 30 July 2017 - 09:32 AM

Here's the patch so downloads and missions are sorted without "The" and "A" but displayed with them on the left

 

https://www.mediafir...idaoe4yv513iyr7



#35 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 11921 posts

Posted 30 July 2017 - 10:00 AM

 

So at the shop spawn the dictionary should contain pairs from both the def file and the map file (if the item is in both?)

 

 

I'd rather not give answers to questions w/o walking through all the steps of the code; this isn't something that's on the tip of my tongue.

 

I don't have time to do that right now. So it'll be up to you or whoever decides to take on this issue to walk through the code to see what it actually does, with various examples to test all the combinations.



#36 AlexDiru

AlexDiru

    Member

  • Member
  • PipPip
  • 30 posts

Posted 30 July 2017 - 10:10 AM

Yeah I think I'll leave it for now. It's fairly complex (for such a small thing) and I don't have the mapping or scripting experience (yet)



#37 AlexDiru

AlexDiru

    Member

  • Member
  • PipPip
  • 30 posts

Posted 30 July 2017 - 10:32 AM

If I patch some other bugs, is there a specific place to send them to? Or should I just post them here?


  • Anderson likes this

#38 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 11921 posts

Posted 30 July 2017 - 11:01 AM

PM them to me.


  • Bikerdude and AlexDiru like this

#39 kingsal

kingsal

    Member

  • Member
  • PipPip
  • 185 posts

Posted 30 July 2017 - 12:07 PM

Oh boy, I didn't realize that was going to turn into such a complex fix for such a small bug :) But nonetheless, its good to get some understanding of how the shop handles items.  This only occurred to me while making persistent items across multiple missions in this case The Stone.

 

Thanks Alex and Grayman for looking into that. I'm excited to see what contributions you make Alex!


  • Anderson likes this

#40 AlexDiru

AlexDiru

    Member

  • Member
  • PipPip
  • 30 posts

Posted 30 July 2017 - 12:27 PM

Yeah I thought it was the simplest one to start with!

 

Do you have any resources which will give me an understanding of how idTech does graphics (never really done much low level graphics programming) and AI (again, never done low level AI)? Even if it's just generic resources not specifically idTech. (Extra points for books, I love books)

 

Lots of the tickets are to do with graphics and AI; I wouldn't know where to begin!


  • Anderson likes this

#41 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 8045 posts

Posted 30 July 2017 - 12:44 PM

Yeah I thought it was the simplest one to start with!

 

Do you have any resources which will give me an understanding of how idTech does graphics (never really done much low level graphics programming) and AI (again, never done low level AI)? Even if it's just generic resources not specifically idTech. (Extra points for books, I love books)

 

Lots of the tickets are to do with graphics and AI; I wouldn't know where to begin!

 

Start here:

 

http://fabiensanglar...doom3/index.php


  • HMart and AlexDiru like this
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#42 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1284 posts

Posted 04 August 2017 - 09:07 AM

@AlexDiru: You wrote that you like books about programming. There is currently an offer on HumbleBundle about Unreal Engine and Unity 5. It is not id, but I thought it might still interest you. Here is the link: https://www.humblebu...ty5-book-bundle


  • AlexDiru likes this

#43 Anderson

Anderson

    Advanced Member

  • Member
  • PipPipPip
  • 796 posts

Posted 07 August 2017 - 10:49 AM

 

 

Lots of the tickets are to do with graphics and AI; I wouldn't know where to begin!

 

You seem to have finished the one you started and only need to wait for a response from Aluminium Haste on this: http://bugs.thedarkm...iew.php?id=4488

​Could you check out mine? The bugtracker issue is fresh but the issue has actually been dragging on for 2 years. Never managed to set it up properly. There were some people that helped me a great deal, but somewhere halfway through, one forum member, Tels just went AWOL and I'm stuck. I really, really dream to see this make it into the 2.06 version of the game.

 

http://bugs.thedarkm...iew.php?id=4523


Edited by Anderson, 07 August 2017 - 10:57 AM.

 "I really perceive that vanity about which most men merely prate — the vanity of the human or temporal life. I live continually in a reverie of the future. I have no faith in human perfectibility. I think that human exertion will have no appreciable effect upon humanity. Man is now only more active — not more happy — nor more wise, than he was 6000 years ago. The result will never vary — and to suppose that it will, is to suppose that the foregone man has lived in vain — that the foregone time is but the rudiment of the future — that the myriads who have perished have not been upon equal footing with ourselves — nor are we with our posterity. I cannot agree to lose sight of man the individual, in man the mass."...

 

 

- 2 July 1844 letter to James Russell Lowell from Edgar Allan Poe.

 


#44 AlexDiru

AlexDiru

    Member

  • Member
  • PipPip
  • 30 posts

Posted 11 August 2017 - 09:25 AM

To me that seems like an art problem if it's in the pk4 file. Does it work by replacing the current pk4 file with the one that worked?


  • Anderson likes this

#45 AlexDiru

AlexDiru

    Member

  • Member
  • PipPip
  • 30 posts

Posted 11 August 2017 - 09:25 AM

Edit: Deleted double post


Edited by AlexDiru, 11 August 2017 - 09:27 AM.

  • Anderson likes this

#46 Anderson

Anderson

    Advanced Member

  • Member
  • PipPipPip
  • 796 posts

Posted 11 August 2017 - 09:36 AM

To me that seems like an art problem if it's in the pk4 file. Does it work by replacing the current pk4 file with the one that worked?

 

I already hosted a file on Google Drive a replace of the pk4 file with working words but they are just placeholder plain latin words without umlauts. I just wanted to see if the issue is acknowledged for 2.06. You can find it here: http://forums.thedar...for-bugtracker/

 

The deeper long term issue is connected to missing fonts in Unicode that the game can't read. This concerns diacritics such as for example ă,î, â. 

More details here:

http://bugs.thedarkm...iew.php?id=2778

http://bugs.thedarkm...iew.php?id=2779
http://bugs.thedarkm...iew.php?id=1610


Edited by Anderson, 11 August 2017 - 09:37 AM.

 "I really perceive that vanity about which most men merely prate — the vanity of the human or temporal life. I live continually in a reverie of the future. I have no faith in human perfectibility. I think that human exertion will have no appreciable effect upon humanity. Man is now only more active — not more happy — nor more wise, than he was 6000 years ago. The result will never vary — and to suppose that it will, is to suppose that the foregone man has lived in vain — that the foregone time is but the rudiment of the future — that the myriads who have perished have not been upon equal footing with ourselves — nor are we with our posterity. I cannot agree to lose sight of man the individual, in man the mass."...

 

 

- 2 July 1844 letter to James Russell Lowell from Edgar Allan Poe.

 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users