• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 05:57
CEST 11:57
KST 18:57
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL19] Finals Recap: Standing Tall9HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy6
Community News
Flash Announces Hiatus From ASL62Weekly Cups (June 23-29): Reynor in world title form?13FEL Cracov 2025 (July 27) - $8000 live event21Esports World Cup 2025 - Final Player Roster16Weekly Cups (June 16-22): Clem strikes back1
StarCraft 2
General
The SCII GOAT: A statistical Evaluation Statistics for vetoed/disliked maps Program: SC2 / XSplit / OBS Scene Switcher Weekly Cups (June 23-29): Reynor in world title form? PiG Sty Festival #5: Playoffs Preview + Groups Recap
Tourneys
RSL: Revival, a new crowdfunded tournament series WardiTV Mondays FEL Cracov 2025 (July 27) - $8000 live event Korean Starcraft League Week 77 Master Swan Open (Global Bronze-Master 2)
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma Mutation # 477 Slow and Steady
Brood War
General
Flash Announces Hiatus From ASL Player “Jedi” cheat on CSL Practice Partners (Official) ASL20 Preliminary Maps SC uni coach streams logging into betting site
Tourneys
[BSL20] Grand Finals - Sunday 20:00 CET [Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL20] GosuLeague RO16 - Tue & Wed 20:00+CET
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Path of Exile Stormgate/Frost Giant Megathread Nintendo Switch Thread What do you want from future RTS games? Beyond All Reason
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Trading/Investing Thread Things Aren’t Peaceful in Palestine The Games Industry And ATVI
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread Formula 1 Discussion NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Blogs
Culture Clash in Video Games…
TrAiDoS
from making sc maps to makin…
Husyelt
Blog #2
tankgirl
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 702 users

The Big Programming Thread - Page 163

Forum Index > General Forum
Post a Reply
Prev 1 161 162 163 164 165 1031 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
Sub40APM
Profile Joined August 2010
6336 Posts
September 04 2012 05:47 GMT
#3241
Ya so, wasypants has a good point. If you want to 'truly' understand you should start with a language that builds everything up from scratch. But do you have the willpower to grind through that? Because like he also said, with python you can be doing legitimately useful programs from almost day 1 and ya there will be an element of 'magic' to it in the sense that you wont actually know how what you ordered python to do worked under the hood...

I have known many more people who gave up on C and general programming than Python...
phar
Profile Joined August 2011
United States1080 Posts
September 04 2012 07:25 GMT
#3242
I would argue that to get someone interested in programming, you shouldn't hit them with a sledgehammer (C) to begin with. Attrition is going to be a lot lower if you start out actually making stuff, instead of spending 95% of your time fighting with gcc.

I would also argue that C is not a bottom-up approach. If you really want to understand wtf is going on, go like... E&M -> transistors -> architecture -> C. But, not everybody is going to want to learn the really low-level stuff. There are some people who find it fascinating (I am one of those people), but people think it's boring as ungodly fuck.

Also, most of the low level shit just does not matter for 99.9% of the software you do at a high level. Being able to modularize your code, use good designs, and make it readable so other people can mess with it is much more important (where "other people" == "you in 6 months", after you've completely forgotten wtf those 10k loc do).



All that said, if you continue programming, you really should learn C eventually because it's good for you :p
Who after all is today speaking about the destruction of the Armenians?
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 04 2012 07:34 GMT
#3243
anyone have any tips on learning Java?

I come from a strong Lisp (Scheme specifically) background and I know Python fairly well in addition. I need to learn Java this semester. Very basic general stuff can be helpful for me. I like knowing the constraints or specifics of a language regarding its very basic ideas: things like, in Lisp everything has the value #t except for #f, whether doing tail-recursion has any benefits over regular recursion, (in Python tail-recursion has no benefit) syntax things to consider (parentheses in Lisp anyone? Also the fucking colons after all the loops in Python kept screwing me over lol)
Tobberoth
Profile Joined August 2010
Sweden6375 Posts
September 04 2012 07:54 GMT
#3244
On September 04 2012 16:34 wherebugsgo wrote:
anyone have any tips on learning Java?

I come from a strong Lisp (Scheme specifically) background and I know Python fairly well in addition. I need to learn Java this semester. Very basic general stuff can be helpful for me. I like knowing the constraints or specifics of a language regarding its very basic ideas: things like, in Lisp everything has the value #t except for #f, whether doing tail-recursion has any benefits over regular recursion, (in Python tail-recursion has no benefit) syntax things to consider (parentheses in Lisp anyone? Also the fucking colons after all the loops in Python kept screwing me over lol)

Generally, I'd say you'll want "high-level" books since you already know how to program and prefer the more technical aspects... I guess an o'rielly book or something like that.

It's also possible that Java has something like all of microsofts products, certification tests etc. The books etc for those, are the SHIT. Since the company which developed the framework etc aims to get you certified, they teach more or less everything from the ground up. Instead of going "How to start coding in X" you go "How to know everything about X".
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 04 2012 08:43 GMT
#3245
On September 04 2012 16:54 Tobberoth wrote:
Show nested quote +
On September 04 2012 16:34 wherebugsgo wrote:
anyone have any tips on learning Java?

I come from a strong Lisp (Scheme specifically) background and I know Python fairly well in addition. I need to learn Java this semester. Very basic general stuff can be helpful for me. I like knowing the constraints or specifics of a language regarding its very basic ideas: things like, in Lisp everything has the value #t except for #f, whether doing tail-recursion has any benefits over regular recursion, (in Python tail-recursion has no benefit) syntax things to consider (parentheses in Lisp anyone? Also the fucking colons after all the loops in Python kept screwing me over lol)

Generally, I'd say you'll want "high-level" books since you already know how to program and prefer the more technical aspects... I guess an o'rielly book or something like that.

It's also possible that Java has something like all of microsofts products, certification tests etc. The books etc for those, are the SHIT. Since the company which developed the framework etc aims to get you certified, they teach more or less everything from the ground up. Instead of going "How to start coding in X" you go "How to know everything about X".


Yeah so our "official" book is Head First Java (O'Reilly) and it's been recommended we check out the Gosling reference (since he created the language). I take it O'Reilly's text is a good book?

This stuff is a bit foreign to me as I didn't really use a text to learn Python and I used MIT's text to learn Scheme.
phar
Profile Joined August 2011
United States1080 Posts
Last Edited: 2012-09-05 04:05:40
September 05 2012 04:04 GMT
#3246
On September 04 2012 16:34 wherebugsgo wrote:
anyone have any tips on learning Java?

I come from a strong Lisp (Scheme specifically) background and I know Python fairly well in addition. I need to learn Java this semester. Very basic general stuff can be helpful for me. I like knowing the constraints or specifics of a language regarding its very basic ideas: things like, in Lisp everything has the value #t except for #f, whether doing tail-recursion has any benefits over regular recursion, (in Python tail-recursion has no benefit) syntax things to consider (parentheses in Lisp anyone? Also the fucking colons after all the loops in Python kept screwing me over lol)

Do you know C at all? If you know C, you already know many of the basic constraints in java, especially if you're talking about syntax. If you're any decent at the proper OO constructions in python, it won't be that hard to transition into java.

The official sun tutorials are pretty decent for a first start:

http://docs.oracle.com/javase/tutorial/

s/sun/oracle/


There's an excellent reference - Effective Java, but I'm not sure it's suitable for learning the basics. It's by Joshua Bloch, who wrote significant portions of the java language (the good parts too :p).

Yea reading through bits of it right now, doesn't seem like it'd be that useful for you. Start with a basic text or the official tutorials and see how it goes.


I also strongly suggest that you start off on the right foot and follow an actual style guide (pick one), even while you're first learning. It won't teach you anything about the language itself, but it will help other people be able to help you with your code when you inevitably have to ask for help (everyone does).

official one: http://www.oracle.com/technetwork/java/javase/documentation/codeconvtoc-136057.html



Really though, just start hacking with it. Reading a book or guide isn't gonna go that far. Mess around, build shit, break stuff, ask for help.
Who after all is today speaking about the destruction of the Armenians?
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 05 2012 07:50 GMT
#3247
yeah, I have 0 experience with C. Having programmed a bit in Java today (I finished a few small functions, one that finds sociable pairs) I feel more comfortable, but it's still a little weird having to denote what variables are before using them and whatnot.

Thanks for the references! I'll definitely check them out.
Frigo
Profile Joined August 2009
Hungary1023 Posts
September 05 2012 09:24 GMT
#3248
I also advise you to read Clean Code and learn how to use Eclipse and its various refactor options.
http://www.fimfiction.net/user/Treasure_Chest
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 05 2012 15:43 GMT
#3249
On September 05 2012 18:24 Frigo wrote:
I also advise you to read Clean Code and learn how to use Eclipse and its various refactor options.


Don't think I'll be using Eclipse, I like emacs too much :p
LukeNukeEm
Profile Joined February 2012
31 Posts
Last Edited: 2012-09-06 00:49:37
September 05 2012 23:38 GMT
#3250
Has anyone here implemented an Octree into a raytracer/pathtracer or something similar? I'm getting somewhat frustrated T_T

edit: as usual, you try to find the answer on your own for hours and get nothing. then you post your question and find the answer on your own 5 minutes later. ^_^
DarkGeneral
Profile Blog Joined September 2003
Canada328 Posts
Last Edited: 2012-09-06 00:05:16
September 06 2012 00:01 GMT
#3251
Hello TL Programmers

A few weeks ago I decided that I wanted to learn and master HTML/CSS/Javascript and SQL.

To solidify my learnings as I went forward, I started a web based game project.

My project is Knights of Drakon, a top down oldschool RPG written entirely in JavaScript/html/css.
Link to my game

The reason I come here is to ask for some advice from seasoned programmers regarding certain game parts.

Im gonna just ask my questions and hope someone will answer

1. How do I code an Armor mitigation function/class?
For example the player has 112 armor, and is level 4, the enemy is lvl 6. How do I make it that 112 turns into a certain % reduction?
such that more player/monster level difference affects the % and also the more the static armor, the less stacking effect it has, such as a diminishing return or a softcap

2. Same as above for a dodge system.

3. Whats the best way to code a turn based 1v1 combat versus a monster. Player attacks, then the monster attacks, so on so forth, untill one is dead. I know this one is a broad scope question, But ANY idea and input is greatly appreciated




Furthermore and possibly off topic, I have my hands full and would appreciate people partnering up with me and contributing to the site, Id love experienced people in all backgrounds, Arists, Coders, Webmaster, Gamedesigners, Level Designers, and someone to help me set up forums for the project, email me from the site or PM here

Thanks TL

"Everybody gotta die some time, righ'?" - Wraith Pilot
LukeNukeEm
Profile Joined February 2012
31 Posts
Last Edited: 2012-09-06 00:28:08
September 06 2012 00:27 GMT
#3252
On September 06 2012 09:01 DarkGeneral wrote:
1. How do I code an Armor mitigation function/class?
For example the player has 112 armor, and is level 4, the enemy is lvl 6. How do I make it that 112 turns into a certain % reduction?
such that more player/monster level difference affects the % and also the more the static armor, the less stacking effect it has, such as a diminishing return or a softcap


You could do something like:
dmgModifier = 100 / (100 + armor);
dmgOut = dmgModifier * dmgIn;

Adjust the numbers to what you feel works best for you.


DarkGeneral
Profile Blog Joined September 2003
Canada328 Posts
September 06 2012 00:46 GMT
#3253
On September 06 2012 09:27 LukeNukeEm wrote:
Show nested quote +
On September 06 2012 09:01 DarkGeneral wrote:
1. How do I code an Armor mitigation function/class?
For example the player has 112 armor, and is level 4, the enemy is lvl 6. How do I make it that 112 turns into a certain % reduction?
such that more player/monster level difference affects the % and also the more the static armor, the less stacking effect it has, such as a diminishing return or a softcap


You could do something like:
dmgModifier = 100 / (100 + armor);
dmgOut = dmgModifier * dmgIn;

Adjust the numbers to what you feel works best for you.




Sweet, I like that. Any ideas on how to play level difference into this calculation?
"Everybody gotta die some time, righ'?" - Wraith Pilot
LukeNukeEm
Profile Joined February 2012
31 Posts
September 06 2012 00:53 GMT
#3254
On September 06 2012 09:46 DarkGeneral wrote:
Show nested quote +
On September 06 2012 09:27 LukeNukeEm wrote:
On September 06 2012 09:01 DarkGeneral wrote:
1. How do I code an Armor mitigation function/class?
For example the player has 112 armor, and is level 4, the enemy is lvl 6. How do I make it that 112 turns into a certain % reduction?
such that more player/monster level difference affects the % and also the more the static armor, the less stacking effect it has, such as a diminishing return or a softcap


You could do something like:
dmgModifier = 100 / (100 + armor);
dmgOut = dmgModifier * dmgIn;

Adjust the numbers to what you feel works best for you.




Sweet, I like that. Any ideas on how to play level difference into this calculation?


Just do the same thing again - pretend that each level is worth 50 armor or so. either work it in the existing modifier, or create a new one and multiply both, e.g:
lvlDiffModifier = 100 / (100 + 50 * lvlDiff);
dmgOut = armorModifier * lvlDiffModifier * dmgIn
Brutland
Profile Joined February 2011
United States92 Posts
Last Edited: 2012-09-06 00:57:05
September 06 2012 00:54 GMT
#3255
dmgMod= LvlMod*(100/(100+cArmor)
dmgOut=dmgIn*dmgMod

LvlMod= abs(charLvl-oppLvl)*whatever percent or modifying fn here
"I drank What?"
LukeNukeEm
Profile Joined February 2012
31 Posts
September 06 2012 00:57 GMT
#3256
On September 06 2012 09:54 Brutland wrote:
dmgMod= abs((oppLvl-charLvl))*(100/(100+cArmor)
dmgOut=dmgIn*dmgMod


this would result in getting the same modifiers for lvl4 vs lvl6 / lvl 6 vs lvl 4
Craton
Profile Blog Joined December 2009
United States17246 Posts
September 06 2012 01:09 GMT
#3257
On September 05 2012 16:50 wherebugsgo wrote:
yeah, I have 0 experience with C. Having programmed a bit in Java today (I finished a few small functions, one that finds sociable pairs) I feel more comfortable, but it's still a little weird having to denote what variables are before using them and whatnot.

Thanks for the references! I'll definitely check them out.

It feels weird as hell not to when you started the other way.
twitch.tv/cratonz
DarkGeneral
Profile Blog Joined September 2003
Canada328 Posts
September 06 2012 01:10 GMT
#3258
On September 06 2012 09:53 LukeNukeEm wrote:
Show nested quote +
On September 06 2012 09:46 DarkGeneral wrote:
On September 06 2012 09:27 LukeNukeEm wrote:
On September 06 2012 09:01 DarkGeneral wrote:
1. How do I code an Armor mitigation function/class?
For example the player has 112 armor, and is level 4, the enemy is lvl 6. How do I make it that 112 turns into a certain % reduction?
such that more player/monster level difference affects the % and also the more the static armor, the less stacking effect it has, such as a diminishing return or a softcap


You could do something like:
dmgModifier = 100 / (100 + armor);
dmgOut = dmgModifier * dmgIn;

Adjust the numbers to what you feel works best for you.




Sweet, I like that. Any ideas on how to play level difference into this calculation?


Just do the same thing again - pretend that each level is worth 50 armor or so. either work it in the existing modifier, or create a new one and multiply both, e.g:
lvlDiffModifier = 100 / (100 + 50 * lvlDiff);
dmgOut = armorModifier * lvlDiffModifier * dmgIn


Beautiful simplcity,

now for the last aspect, how would I implement diminishing returns?

As the number increases and the % approaches lets say 70% the % amount per armor point would have to curve down, what is the best way to do that?
"Everybody gotta die some time, righ'?" - Wraith Pilot
phar
Profile Joined August 2011
United States1080 Posts
September 06 2012 04:16 GMT
#3259
On September 06 2012 00:43 wherebugsgo wrote:
Show nested quote +
On September 05 2012 18:24 Frigo wrote:
I also advise you to read Clean Code and learn how to use Eclipse and its various refactor options.


Don't think I'll be using Eclipse, I like emacs too much :p

Eclipse is a huge timesaver for Java. If you're not going to be writing that much code it won't matter, but if you have to crank out like 4k loc a week, Eclipse helps with the RSI :\

If this is for ar Uni class, just use whatever you're most comfortable with. But the default auto complete / auto import / auto getter/setter /etc stuff that's built in to Eclipse is really handy.
Who after all is today speaking about the destruction of the Armenians?
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 06 2012 05:46 GMT
#3260
On September 06 2012 13:16 phar wrote:
Show nested quote +
On September 06 2012 00:43 wherebugsgo wrote:
On September 05 2012 18:24 Frigo wrote:
I also advise you to read Clean Code and learn how to use Eclipse and its various refactor options.


Don't think I'll be using Eclipse, I like emacs too much :p

Eclipse is a huge timesaver for Java. If you're not going to be writing that much code it won't matter, but if you have to crank out like 4k loc a week, Eclipse helps with the RSI :\

If this is for ar Uni class, just use whatever you're most comfortable with. But the default auto complete / auto import / auto getter/setter /etc stuff that's built in to Eclipse is really handy.


yeah so it's for a university class (UC Berkeley) and our "official" text editor is emacs. We have been told that we can use Eclipse if we want to, but our prof made a list of things he hates about Eclipse and most of us learned on vim/emacs anyway so it's not a huge deal.

Prev 1 161 162 163 164 165 1031 Next
Please log in or register to reply.
Live Events Refresh
Next event in 3m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Tasteless 330
Crank 145
MindelVK 24
Rex 0
StarCraft: Brood War
Sea 8791
Horang2 3481
Bisu 881
Hyuk 652
Leta 264
Jaedong 263
Soma 240
Rain 186
PianO 165
TY 147
[ Show more ]
ToSsGirL 143
Killer 130
EffOrt 124
ZerO 121
Shuttle 54
Rush 53
JulyZerg 44
zelot 24
Free 23
HiyA 22
Hyun 12
ajuk12(nOOB) 11
Sacsri 10
Movie 8
ivOry 4
Calm 0
Dota 2
XaKoH 755
XcaliburYe693
Fuzer 214
League of Legends
JimRising 667
Counter-Strike
Stewie2K1875
Heroes of the Storm
Khaldor284
Other Games
Happy502
Pyrionflax244
crisheroes202
ZerO(Twitch)19
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• Berry_CruncH319
• LUISG 33
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• lizZardDota2317
League of Legends
• Lourlo1223
Upcoming Events
RSL Revival
3m
Clem vs Classic
SHIN vs Cure
Tasteless330
Crank 145
3DClanTV 0
FEL
2h 3m
WardiTV European League
2h 3m
BSL: ProLeague
8h 3m
Dewalt vs Bonyth
Replay Cast
1d 14h
Sparkling Tuna Cup
2 days
WardiTV European League
2 days
The PondCast
3 days
Replay Cast
3 days
RSL Revival
4 days
[ Show More ]
Replay Cast
4 days
RSL Revival
5 days
FEL
5 days
RSL Revival
6 days
FEL
6 days
FEL
6 days
Liquipedia Results

Completed

BSL 2v2 Season 3
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL Season 20
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Championship of Russia 2025
RSL Revival: Season 1
Murky Cup #2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025

Upcoming

2025 ACS Season 2: Qualifier
CSLPRO Last Chance 2025
2025 ACS Season 2
CSLPRO Chat StarLAN 3
K-Championship
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.